简体   繁体   中英

C# Check box, only check the box not the text

Okay i swear i looked for this on google before posting.

I tried:

C# check box active area C# check box check box not text

and a few others.

But i have a check box on top of a button. I want to be able to click the button even when the mouse is over top the check box text area. I want the use to only be able to click the actual box. But when the mouse is over the check box's text, it should click the button.

Thanks all!

I'm assuming this is in WPF / XAML.

Simply add the checkbox to the button without text. Add the text to the button not the checkbox.

That said, I cannot for the world think why this would be a pleasant user experience and would suggest trying to use a different means of getting the information.

So instead of having the checkboxes over top the button, i just created a seperate window that will show with the three options to choose from upon clicking that button.

But i still think it would be cool/neat to have them on top of the button.

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