Dim boolEmpty As Boolean = False
Sub txtEggValidate()
With Me
'Reset txtbox colors back to white
.txtEggNick.BackColor = Color.White
.txtEggOwner.BackColor = Color.White
.cbEggIP.SelectedIndex = 0
.cbEggIP.BackColor = Color.White
.txtEggPort.BackColor = Color.White
.txtEggNetwork.BackColor = Color.White
.txtEggServer.BackColor = Color.White
.txtEggChans.BackColor = Color.White
'Verify all the items are filled out/selected and change backcolor if they aren't
If .txtEggNick.Text = "" Then
.txtEggNick.BackColor = Color.LightPink
boolEmpty = True
End If
If .txtEggOwner.Text = "" Then
.txtEggOwner.BackColor = Color.LightPink
boolEmpty = True
End If
If .cbEggIP.Text = "" Then
.cbEggIP.BackColor = Color.LightPink
boolEmpty = True
End If
If .txtEggPort.Text = "" Then
.txtEggPort.BackColor = Color.LightPink
boolEmpty = True
End If
If .txtEggNetwork.Text = "" Then
.txtEggNetwork.BackColor = Color.LightPink
boolEmpty = True
End If
If .txtEggServer.Text = "" Then
.txtEggServer.BackColor = Color.LightPink
boolEmpty = True
End If
If .txtEggChans.Text = "" Then
.txtEggChans.BackColor = Color.LightPink
boolEmpty = True
End If
'Throw messagebox if one of the fields was not filled out correctly
If boolEmpty = True Then
MessageBox.Show("Please verify all of the information is filled out.", "Input error")
Exit Sub
End If
End With
End Sub
'Exit button click sub if bool comes out true
if boolEmpty = true then
exit sub
end if