# textbox (form control): i'd like to insert example text that automatically desappear once clicked with mouse. how to?

Example: creating a form in which users are requested to insert emails. i create the textbox with form controls, and inside the textbox i write name@yourdomain.com. once you click on the textbox, i want that example text automatically disappear and the field becomes empty. How to do it? i've tried several ways but can't solve. i'd like to do as every f*g form does everywhere.

edit retag close merge delete

Sort by » oldest newest most voted

I think the only way is to use a Macro.
Using the "When receiving focus" event of the text box to run a Macro that sets the Text property of the text box to empty "".


Sub Tclear(oEvent)
Tbox = oEvent.Source
Tbox.Text = ""
End Sub


You can use this Macro for any text box on any form as it uses the event argument oEvent to identify the text box.

more