.net winforms 中有Radio grop 按钮吗?

发布于 2024-09-06 16:20:45 字数 81 浏览 2 评论 0原文

有一个名为checkedListBox1的选项用于复选框组项目。

就像单选按钮的任何控件一样。以及如何在其中绑定我的数据(数据集)。

There is option called checkedListBox1 for check box group item..

Like that any control for radio button. and how to bind my data(data set) in that.

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

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

发布评论

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

评论(3

喜爱纠缠 2024-09-13 16:20:46

用户容器具有与组名称相同的功能。

容器可以是组框或面板

User container to have same functionality as like group name.

container can be group box or Panel

放赐 2024-09-13 16:20:46

单选按钮没有这样的东西。不过,您可以寻找第三方控件或扩展现有的 CheckedListBox,以便一次只能检查一项。

第二种解决方案有点难看,因为看到复选框,用户会希望能够选择多个选项。

There is no such thing for radio buttons. You may, however, look for third party controls or extend the existing CheckedListBox so that only one item at a time can be checked.

The second solution is a bit ugly, because seeing check boxes the user would expect to be allowed to select more than one option.

家住魔仙堡 2024-09-13 16:20:46

将单选按钮放在自己的面板中,它们将一起工作,面板中只有一个按钮可选。

至于数据绑定,有多种方法可用,例如为每个选项创建表单布尔属性,并将每个单选按钮绑定到其属性。

更简单的方法是使用 Jay Andrew Allen 的 RadioPanel< /a>,它负责将单选按钮选项绑定到枚举字段。

Put the radio buttons in their own panel, and they will work together, with only one button in the panel being selectable.

As for data-binding, there are several approaches available, such as creating a form Boolean property for each option, and binding each radio button to its property.

An easier approach would be to use Jay Andrew Allen's RadioPanel, which takes care of binding the radio button options to an enumeration field.

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