UserForm cosmetics...

S

Steven Saville

I have a userform such as the low-res picture in the attachment. When a
textbox is selected (by tab or mouse) I wish the default/inactive text shown
in that textbox to disappear. When the textbox is then deselected I wish
the default/inactive text to reappear if nothing was typed in.
The reason why I can't work this out is because there is no recognised vba
action of the textbox being selected (to my knowledge or search).
Thanks,
Steve.
 
T

Tom Ogilvy

In the object browser, in the MSForms library, look at the Control object.
This is the container for the textbox when it is on a userform. It gives
the textbox Enter and Exit Events plus beforeUpdate and AfterUpdate.

If, in the userform module, you select your textbox in the left dropdown,
then in the right dropdown you will have listed all the available events.
When you select one, it will enter the proper declaration in your module.
You should always enter event declarations this way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top