简体   繁体   中英

2 Buttons but just one work in wpf window

I want to insert 2 Buttons in my C# Project. But just one of them works. I Tried different things, and i noticed in the second button script BorderBrush="{x:Null}" /> is a /> i think this is the problem. But at the time i remove it / convert it to a > it gives me an error out.

But heres the code, maybe you can help:

*Edit: Code is to long so heres a Link: http://pastebin.com/MysA7Dh1 **Edit: First a big Thanks for the Help :)! And i dont want you to do the work for me but i dont find an solution. The first button just looks like the second on the xaml code for me. But now i can click the button but this time i dont see the image. I see it on the first button but not on the second.

Updated code: http://pastebin.com/PZhtssSy

nvm i set the Margin wrong. :/

Are you trying to include that image inside the button code? Or is the image supposed to be separate?

If you're trying to include the image inside the button, your code should look like this (code overly simplified for clarity):

<Button>
    <Image/>
</Button>

If they are supposed to be separate:

<Button />
<Image />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM