You can work with 2 seperate functions. The first one includes the 3 radiobuttons for the size and the other one includes the radiobuttons for the color. Use the If-structure to see what is checked so the program can change the outcome.
Posts: 1960 Reputation: 31
37 / /
Joined: Mar 2003
O.P. RE: VB.NET radio buttons help
How do you mean?
I tried it like this, but it doesn't work
code:Function grootte()
If (RadioButton1.Checked = True) Then
MsgBox("button1")
ElseIf (RadioButton2.Checked = True) Then
MsgBox("button2")
ElseIf (RadioButton3.Checked = True) Then
MsgBox("button3")
End If
End Function
Function kleur()
If (RadioButton4.Checked = True) Then
MsgBox("button4")
ElseIf (RadioButton5.Checked = True) Then
MsgBox("button5")
End If
End Function
code:Private Function grootte()
If RadioButton1.Checked = True Then
MessageBox.Show("button1")
ElseIf RadioButton2.Checked = True Then
MessageBox.Show("button2")
ElseIf RadioButton3.Checked = True Then
MessageBox.Show("button3")
End If
End Function
Private Function kleur()
If RadioButton4.Checked = True Then
MsgBox("button4")
ElseIf RadioButton5.Checked = True Then
MsgBox("button5")
End If
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
grootte()
kleur()
End Sub