0

Hi,

I have my program all programmed but,
i want to have only one button!
How can i make it so if the radio button is selected it will do a certain sector of the code when the the actual button is pressed iv had a good attempt at if - A fail attempt but heres what i did

if RadioButton2.Checked = False Then
*my Code Here*
End if 

If RadioButton1.Checked = False Then
*my Code Here*
End if

Edited by mr3army: n/a

2
Contributors
4
Replies
5
Views
6 Years
Discussion Span
Last Post by mr3army
0

Hi,

You can try something like this:

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, _
    RadioButton2.CheckedChanged
        If RadioButton1.Checked Then
            MsgBox("You clicked Radiobutton1")
        End If
        If RadioButton2.Checked Then
            MsgBox("You clicked Radiobutton2")
        End If
    End Sub
0

Hi,

You can try something like this:

Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged, _
    RadioButton2.CheckedChanged
        If RadioButton1.Checked Then
            MsgBox("You clicked Radiobutton1")
        End If
        If RadioButton2.Checked Then
            MsgBox("You clicked Radiobutton2")
        End If
    End Sub

Worked Great Now i have another problem if you like to check out my other thread now :S

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.