Using c# windows form, hosting a wpf user control, the buttons on the user control only allow a click on the content of the button, but not on the button’s blank space. Is there a property that changes this?
Have you got the click handler on the content rather than the button? I tend to code buttons as:
<Button Content="Click Me!" Clicked="OnClickMeClicked"/>
You might have:
<Button><TextBlock Text="Click Me!" MouseLeftButtonDown="OnClickMeClicked"/></Button>
(Although that seems unlikely, but it’s possible.)
I’m always caught out by windows that don’t have a fill, even a transparent fill, associated with them. If it isn’t painted, it isn’t clickable!
No TweetBacks yet. (Be the first to Tweet this post)
February 27th, 2010 at 3:51 pm
Have you got the click handler on the content rather than the button? I tend to code buttons as:
<Button Content="Click Me!" Clicked="OnClickMeClicked"/>
You might have:
<Button><TextBlock Text="Click Me!" MouseLeftButtonDown="OnClickMeClicked"/></Button>
(Although that seems unlikely, but it’s possible.)
I’m always caught out by windows that don’t have a fill, even a transparent fill, associated with them. If it isn’t painted, it isn’t clickable!
References :