|
-
Feb 27th, 2010, 01:54 PM
#1
Thread Starter
New Member
I want text box to be cleared on click just once...

On my login form I have a username text box and a password text box...
The TxtUsername text box is preset with the following:
Text: Username
Colour: Gray
Here is the code for the TxtUsername (on click):
Private Sub TxtUsername_Click
TxtUsername.Text = ""
TxtUsername.ForeColor = Color.Black
(So it's like the facebook login if your familiar with it)
When user clicks the text box, the gray text already inside gets erased and user is able to type with black text.
The problem is that even when the user has typed in the box, every time you click the text box the text still gets erased... I've been googling and experimenting everything I can't find a thing!
It's like the code should be something like If TxtUsername.Text = Anything but "Username" then dont change it to ""
Or maybe theres a whole different code to type?
Thanks in advanced!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|