zunebuggy65
Active member
- Joined
- Oct 12, 2023
- Messages
- 42
- Programming Experience
- 3-5
So I have 6 radio buttons and a textbox and this event:
Visual Studio does not report any errors and I did an output of rdoButton1.Checked and it is indeed True, but the "rdoButton1.Checked = True" condition is ignored as well as all If Thens nested within.
If I remove that rdoButton1.Checked and just have the test of it like below, it works fine. I have 6 radio buttons and they all share this txtBox1 but selecting the various radio buttons changes the functionality of the textbox.
I really just need a way that if a user changes any text in the textbox that it will check the radio button selected and based on that will do something else.
Thank you.
VB.NET:
Private Sub txtBox1_TextChanged(sender As Object, e As EventArgs) Handles txtBox1.TextChanged
If rdoButton1.Checked = True Then
If txtBox1.Text <> "" Then
If txtBox3.Text <> "" Then
'do some stuff
Else
'do some stuff
End If
Else
'do some stuff
End If
End If
Exit Sub
Visual Studio does not report any errors and I did an output of rdoButton1.Checked and it is indeed True, but the "rdoButton1.Checked = True" condition is ignored as well as all If Thens nested within.
If I remove that rdoButton1.Checked and just have the test of it like below, it works fine. I have 6 radio buttons and they all share this txtBox1 but selecting the various radio buttons changes the functionality of the textbox.
VB.NET:
Private Sub txtBox1_TextChanged(sender As Object, e As EventArgs) Handles txtBox1.TextChanged
If txtBox1.Text <> "" Then
If txtBox3.Text <> "" Then
'do some stuff
Else
'do some stuff
End If
Else
'do some stuff
End If
Exit Sub
I really just need a way that if a user changes any text in the textbox that it will check the radio button selected and based on that will do something else.
Thank you.