ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Message Box Help (https://www.excelbanter.com/excel-programming/405951-message-box-help.html)

Sam

Message Box Help
 
I'm learning the VBA and have created a USERFORM that has several text boxes.
One of the boxes is and address field with multi-line option. I would like
a small message box to "pop" up when the user enters that box telling them
how to make the 2nd line (CTRL+Enter) -- the dissapear when leaving that box.

Is this possible?
--
"To dream of the person you would like to be is to waste the person you are."

carlo

Message Box Help
 
On Feb 12, 1:06*pm, Sam wrote:
I'm learning the VBA and have created a USERFORM that has several text boxes.
*One of the boxes is and address field with multi-line option. *I would like
a small message box to "pop" up when the user enters that box telling them
how to make the 2nd line (CTRL+Enter) -- the dissapear when leaving that box.

Is this possible? *
--
"To dream of the person you would like to be is to waste the person you are."


Hi Sam

First of all, you might consider to change the properties of your
textfield to:
EnterKeyBehavior = True
and
MultiLine = True

That way, the User doesn't need to hit Ctrl + Enter to change the
line, Enter will be sufficent.

If you still want to tell the user what to do, you could add a Label
to the form.
In the onEnter event of your field you set the Label to visible, in
the onExit event you set it to invisible, like that:

Private Sub TextBox1_Enter()

Me.Label1.Visible = True

End Sub

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)

Me.Label1.Visible = False

End Sub

Private Sub UserForm_Initialize()

Me.Label1.Visible = False

End Sub

hope that helps

Carlo

John

Message Box Help
 
Sam,
You can use the ControlTipText Property which will show your message when
the mouse hovers over the control. eg:

Textbox1.ControlTipText = "to make the 2nd line use (CTRL+Enter)"

see Help for more info.

--
JB


"Sam" wrote:

I'm learning the VBA and have created a USERFORM that has several text boxes.
One of the boxes is and address field with multi-line option. I would like
a small message box to "pop" up when the user enters that box telling them
how to make the 2nd line (CTRL+Enter) -- the dissapear when leaving that box.

Is this possible?
--
"To dream of the person you would like to be is to waste the person you are."



All times are GMT +1. The time now is 10:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com