How to write vb.net code to check check box and select listItem item and add them.
Private Sub Buttonon_Click() Handles Button1.Click
listboxvalue.Items.Add("First Name=" + TextBoxvalue1.Text + " Last Name=" + TextBoxvalue2.Text + " Address=" + TextBoxvalue3.Text + " City="
+ ComboBox1.Text + "\nSex=")
If (radiobuttonvalue.Checked = True) Then
listboxvalue.Items.Add("Male")
Else
listboxvalue.Items.Add("Female")
End If
listboxvalue.Items.Add(" Age=" + NumericUpDown1.Value.ToString() + " Hobbies are=")
If (chkvalue1.Checked = True) Then
listboxvalue.Items.Add(" Cricket")
End If
If (chkvalue2.Checked = True) Then
listboxvalue.Items.Add(" Football")
End If
If (chkvalue3.Checked = True) Then
listboxvalue.Items.Add(" Tennis")
End If
If (chkvalue4.Checked = True) Then
listboxvalue.Items.Add(" BasketBall")
End If
End Sub
End Class
Private Sub Buttonon_Click() Handles Button1.Click
listboxvalue.Items.Add("First Name=" + TextBoxvalue1.Text + " Last Name=" + TextBoxvalue2.Text + " Address=" + TextBoxvalue3.Text + " City="
+ ComboBox1.Text + "\nSex=")
If (radiobuttonvalue.Checked = True) Then
listboxvalue.Items.Add("Male")
Else
listboxvalue.Items.Add("Female")
End If
listboxvalue.Items.Add(" Age=" + NumericUpDown1.Value.ToString() + " Hobbies are=")
If (chkvalue1.Checked = True) Then
listboxvalue.Items.Add(" Cricket")
End If
If (chkvalue2.Checked = True) Then
listboxvalue.Items.Add(" Football")
End If
If (chkvalue3.Checked = True) Then
listboxvalue.Items.Add(" Tennis")
End If
If (chkvalue4.Checked = True) Then
listboxvalue.Items.Add(" BasketBall")
End If
End Sub
End Class
0 comments: