I ahve textbox and label .I do have form.having 7 textbox with 7 label.
Firstname : textboxfirstname
LAstname :textboxlastname
ETC.
Enter button.(Image button)
what I am trying to do is if any of the upper field is empty and anyone click the imagebutton than Label should turn into red and text into white.
then when someone add the text inside that and click anywhere or put the curser in nextbox the previous label have to becomes white again.
Can anyone pelase help me out.
Programming Languages-OtherWeb Languages and Standards
Last Comment
Deepak Lakkad
8/22/2022 - Mon
Deepak Lakkad
You have yo write two events
1st for Image button, where you will check if textbox is empty then change font color of associated label e.g. Label1 is associated with TextBox1 then you will write code as below:
IF textbox1.text = "" Then Label1.BackColor = Color.Red Label1.ForeColor = Color.WhiteEnd If
1st for Image button, where you will check if textbox is empty then change font color of associated label e.g. Label1 is associated with TextBox1 then you will write code as below:
Open in new window
same way you can code for other textboxes ...
2nd is Validate Event for TextBox ... The code snippnet is given below:
Open in new window
- Deepak Lakkad