Default text in a textbox that disappears on click (like a search box)

Zak14

Registered User.
Local time
Today, 06:46
Joined
Jun 27, 2014
Messages
166
Hi guys,

Is there an efficient way anyone knows of, to have default text in a textbox on my form (like a search box), but have it so that when a user focuses on the textbox (to type in a search term), the word should disappear.

Just like the search box on windows 7 start menu.

Then, is there a way to have the default text not be the actual text in the box? Otherwise, my search box will search the default text.

Thanks!
 
Sure. Just create a label and then use the OnGotFocusEvent to make it invisible.
Example: lblytd
OnMouseDownEvent
OnMouseMoveEvent
Me.lblytd.Visible = False

OnLostFocusEvent of Control
OnMouseDownEvent
OnMouseMoveEvent

Me.lblytd.Visible = True
OnEnter Me.lblytd.Visible = False
OnExit Me.lblytd.Visible= True

HTH
 
In the textbox's Format property, put

@;"my default text"
 

Users who are viewing this thread

Back
Top Bottom