VB.NET checkbox设计问题
书上的太难,大哥麻烦写下这代码,有两checkbox;texe分别是打球,看书,当选中checkbox显示消息框,提示checkbox.text;取消选择者提示消息框ch...
书上的太难,大哥麻烦写下这代码,有两checkbox;texe分别是打球,看书,当选中checkbox显示消息框,提示checkbox.text;取消选择者提示消息框checkbox.text;单击button1消息框提示我选择checkbox的text的名称
展开
2013-09-10
展开全部
Private Sub CheckBox1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles CheckBox1.Click
MsgBox(CheckBox1.Text)
End Sub Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
MsgBox(CheckBox2.Text)
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckBox1.Checked = True Then
MsgBox(CheckBox1.Text)
End If
If CheckBox2.Checked = True Then
MsgBox(CheckBox2.Text)
End If
End Sub在窗体上画两个checkbox,一个button,名字为默认,checkbox1的text改为打球,checkbox2的text改为看书。
MsgBox(CheckBox1.Text)
End Sub Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
MsgBox(CheckBox2.Text)
End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If CheckBox1.Checked = True Then
MsgBox(CheckBox1.Text)
End If
If CheckBox2.Checked = True Then
MsgBox(CheckBox2.Text)
End If
End Sub在窗体上画两个checkbox,一个button,名字为默认,checkbox1的text改为打球,checkbox2的text改为看书。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询