mardi 24 février 2015

Multiple CheckBoxes and TextBoxes VB.NET

Okay I have Check Boxes set to display code in Text Boxes with one check box checked. Now I am looking on how to check multiple check boxes and have that code displayed to the check box.


What I want is to have "SelectBox" and "UpBox" both checked to display in TextBox1 "0000FFEE", in TextBox2 "0010FFEE", in TextBox3 "00000011", and finally in TextBox4 "00100011".


Example code:



Private Sub SelectBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SelectBox.CheckedChanged
If SelectBox.Checked = True Then
TextBox1.Text = "0000FFFE"
TextBox2.Text = "0010FFFE"
TextBox3.Text = "00000001"
TextBox4.Text = "00100001"
Else
TextBox1.Text = "0000FFFF"
TextBox2.Text = "0010FFFF"
TextBox3.Text = "00000000"
TextBox4.Text = "00100000"

End If
End Sub

Private Sub UpBox_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UpBox.CheckedChanged
If UpBox.Checked = True Then
TextBox1.Text = "0000FFEF"
TextBox2.Text = "0010FFEF"
TextBox3.Text = "00000010"
TextBox4.Text = "00100010"
Else
TextBox1.Text = "0000FFFF"
TextBox2.Text = "0010FFFF"
TextBox3.Text = "00000000"
TextBox4.Text = "00100000"
End If
End Sub




Aucun commentaire:

Enregistrer un commentaire