Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27517

Annoying Radiobutton problem

$
0
0
So i have 3 radio buttons and two text boxes.

When radio button 1 or 2 is clicked it sets the username and password (defaults)

When third button is clicked it's suppose to check if textbox1 (user) and textbox2 (pass) are blank or filled.

If either is blank I want it to set back to radio button 1 and do nothing except pop a msgbox.

If both are filled I want it to set the username and password and stay checked on radio button 3.

Code:

    Private Sub MWSUserPass3_CheckedChanged(sender As Object, e As EventArgs) Handles MWSUserPass3.CheckedChanged
        If MWSUser.Text = "" Or MWSPass.Text = "" Then
            'MsgBox(MWSUser.Text & " " & MWSPass.Text) 'debug
            MWSUserPass1.Checked = True
        End If
        If Not MWSUser.Text = "" And Not MWSPass.Text = "" Then
            strMWSUsername = MWSUser.Text
            strMWSPassword = MWSPass.Text
        End If
    End Sub

However the msgbox comes up twice, so I searched and it has to do with the fact that i checked mwsuserpass1... so if i remove that it only displays one msgbox.. however then it remains on selection 3. I want to revert to radio button 1.

Viewing all articles
Browse latest Browse all 27517

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>