Quantcast
Channel: Using nested IFs
Viewing all articles
Browse latest Browse all 7

Using nested IFs

$
0
0

Hello,

What do you think about this code? it works, but the Q is: is it a good one ?

 

Code Block

Private

Sub btnOK_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles btnOK.Click

 

IfMe.RadioButtonFriendID.Checked = FalseAnd _

                Me.RadioButtonFriendName.Checked = FalseThen

 

MessageBox.Show(

"You didn't check what you are looking for!")

 

ElseIfMe.txtSearchInput.Text.Trim() <> ""And IsNumeric(Me.txtSearchInput.Text) And _

                Me.RadioButtonFriendID.Checked Then

 

MessageBox.Show("You are looking for your Friend ID!")

 

 

Else

IfMe.RadioButtonFriendName.Checked AndMe.txtSearchInput.Text.Trim <> ""Then

MessageBox.Show(

"You are looking for your Friend's name")

Else

MessageBox.Show(

"Wrong input!!")

EndIf

EndIf

EndSub

 

 

 

Thank you in advance

Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles



Latest Images