ListView.CheckBoxes:如何使复选框像RadioButton一样工作. [英] ListView.CheckBoxes: how to make checkboxe work like a RadioButton.

查看:115
本文介绍了ListView.CheckBoxes:如何使复选框像RadioButton一样工作.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一个VB.Net Winform,它在ListView内显示复选框,可以很好地工作.

Hi All,

I have a VB.Net Winform showing checkboxes inside the ListView which works fine.

我想知道如何使复选框像RadioButton一样工作. IE.我应该只允许用户单击一个

I want to know how to make the checkbox work like the RadioButton. ie. I should allow the user to click only one

复选框.如果在两行中有2个复选框,然后选中第二个复选框,则第一个复选框已检查"应该清除.当点击第二复选框时,第一复选框检查"将被选中.

如果有人这样做,请告诉我方法.

checkbox on the listview. If there are 2 checkboxes in 2 rows and then when the 2nd checkbox is checked, the first checkbox "Checked" should be cleared. When the 2nd checkbox is clicked the 1st checkbox "check" to be cleared.
 
If anyone had done this, let me know the way..

谢谢,

 Thanks,

sankar.

推荐答案

这是什么?

私有子CheckBox1_CheckedChanged(ByVal发送者作为System.Object,ByVal e作为System.EventArgs)处理CheckBox1.CheckedChanged
Me.CheckBox2.Checked =不是Me.CheckBox1.Checked
End Sub

私有子CheckBox2_CheckedChanged(ByVal发送者为System.Object,ByVal e为System.EventArgs)处理CheckBox2.CheckedChanged
Me.CheckBox1.Checked =不是Me.CheckBox2.Checked
End Sub
This?

    Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
        Me.CheckBox2.Checked = Not Me.CheckBox1.Checked
    End Sub

    Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
        Me.CheckBox1.Checked = Not Me.CheckBox2.Checked
    End Sub


这篇关于ListView.CheckBoxes:如何使复选框像RadioButton一样工作.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆