My Problem
I have read a few chapters, and researched a few websites but none of which fulfil my question, which is where should I put this If statement
Public LoginName As String
Public Password As String
LoginName = txtUserName.Text
Password = txtPassword.Text
If (LoginName = "" Or Password = "") Then
btnSubmit.BackgroundImage = Image.FromFile("G:\Product\ElderlyEmail\ElderlyEmail\Images\stopbutton.gif")
Else
btnSubmit.BackgroundImage = Image.FromFile("G:\Product\ElderlyEmail\ElderlyEmail\Images\GoButton.gif")
End If
The idea is once the user has finished inputting text into both text-boxes the image on the button changes from a no-go to a green-submit button but unsure what declaration it would go under and which element. I have tried several form elements and declarations but not having the desired effect that I would like
You can use many methods to achieve this behavior. Perhaps the OnLostFocus of the
txtPasswordtextbox is more suitable since you want the validation to take place when user has finished typing. You could also use the OnTextChanged method on each of your textboxes so the validation will run every time the user is typing.