开发者

Several RadioButtons in a group unhandling event

开发者 https://www.devze.com 2023-01-08 07:22 出处:网络
If you have several radiobuttons in a group, and you have Checked event handlers in your code behind, if a radiobutton is checked how do you cancel this event handling so that the new radiobutton clic

If you have several radiobuttons in a group, and you have Checked event handlers in your code behind, if a radiobutton is checked how do you cancel this event handling so that the new radiobutton clicked does not get selected and your original checked button stays checked? The code in the event handler in the code behind distinguishes this - radiobutton is clicked the ev开发者_JAVA技巧ent handler checks some condition, if condition is false do not check new button.


On Mouse PreviewDown event, you can check the condition and set e.Handled=true (IF you don't want to check or uncheck)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号