一组取消处理事件中的多个RadioButton

发布于 2024-09-11 06:01:54 字数 165 浏览 1 评论 0原文

如果一个组中有多个单选按钮,并且后面的代码中有 Checked 事件处理程序,如果单选按钮被选中,如何取消此事件处理,以便单击的新单选按钮不会被选中,并且原始选中的按钮保持选中状态?后面代码中的事件处理程序中的代码对此进行了区分 - 单击单选按钮时,事件处理程序检查某些条件,如果条件为 false,则不检查新按钮。

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 event handler checks some condition, if condition is false do not check new button.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

哥,最终变帅啦 2024-09-18 06:01:54

在 Mouse PreviewDown 事件中,您可以检查条件并设置
e.Handled=true(如果您不想选中或取消选中)

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文