Sean Strickland
asked on
Clean way to change forecolor and backcolor of a textbox (MouseOver)
I'm looking for a clean way to change the fore/back colors of a textbox in Access 97 using the MouseOver event. Is there some quick code that someone can give me that would allow me to "highlight" boxes using this event. I'm looking for a way to maybe use a Public Function and pass the variable that is currently under the mouse through it.
I'm thinking in the MouseOver event, you have some code that says:
ChangeColor(Me.Form.HasFoc us)
And the ChangeColor function would check to make sure that it's a Text Box, and maybe check to see if there is a stored variable in the tag property?
I'm not really sure, I just want the control to change backcolor when it's hovered onto, and revert back when it loses the mouses' focus.
EDIT:
I've been using something similar to the following to do this, but don't want to do it for every control that I put on the form:
I'm thinking in the MouseOver event, you have some code that says:
ChangeColor(Me.Form.HasFoc
And the ChangeColor function would check to make sure that it's a Text Box, and maybe check to see if there is a stored variable in the tag property?
I'm not really sure, I just want the control to change backcolor when it's hovered onto, and revert back when it loses the mouses' focus.
EDIT:
I've been using something similar to the following to do this, but don't want to do it for every control that I put on the form:
Private Sub txtName_MouseOver()
Me.txtName.BackColor = vbWhite
End Sub
Private Sub txtNumber_MouseOver()
Me.txtNumber.BackColor = vbWhite
End Sub
Private Sub Detail_MouseOver()
Me.txtName.BackColor = vbRed
Me.txtNumber.Backcolor = vbRed
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ah - meaning you can't open it?
Hmm... hang fire.
Hmm... hang fire.
Apologoes for not getting back to this as soon as expected.
I eventually converted down to 97 - then though "sod it" and changed it to use Textboxes.
I'm getting a memory address error upon closeup - which I've not get had time to look at.
Here it is for now anyway.
http://www.databasedevelopment.co.uk/experts/TextHover97.zip
I eventually converted down to 97 - then though "sod it" and changed it to use Textboxes.
I'm getting a memory address error upon closeup - which I've not get had time to look at.
Here it is for now anyway.
http://www.databasedevelopment.co.uk/experts/TextHover97.zip
ASKER
"The page cannot be displayed."
Yeah - my website's down at the moment...
Here's the attachments (97 - with remaining error still and 2000 format without - no memory leak).
TextHover97.zip
TextHover.zip
Here's the attachments (97 - with remaining error still and 2000 format without - no memory leak).
TextHover97.zip
TextHover.zip
ASKER