Highlighted text box on mouse over

Stefanovski

Registered User.
Local time
Yesterday, 22:32
Joined
Jan 7, 2005
Messages
21
Hi folks,

Does anybody know how to make your text boxes highlighted on mouse over it? I mean text boxes and not content in text boxes. I have seen it at "MOE", an add-in from Peter's Software. It looks pretty cool but unfortunately I don't know how to apply it in my forms.

Maybe you have some ideas...

Thanks
 
Your post is not really clear!

make your text boxes highlighted on mouse over it? I mean text boxes and not content in text boxes
What exactly do you mean by text boxes highlighted, the back color of the box?
 
missinglinq said:
Your post is not really clear!


What exactly do you mean by text boxes highlighted, the back color of the box?

Sorry for being not clear enough.
I meant highlighted text box borders...
Thanks
 
Here's one way! It "hi-lites" the box by changing the color and width of the box border. You can change the hi-liting by playing around with the color and width as suits your fancy. Hope this helps!

To hi-lite on MouseOver

Code:
Private Sub Text0_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.Text0.BorderColor = 255   'Turns border Red  
    Me.Text0.BorderWidth = 2     'Increases border width
End Sub
To reset when mouse leaves the control

Code:
Private Sub Detail_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Me.Text0.BorderColor = 0   'Returns border to default black
    Me.Text0.BorderWidth = 0   'Returns border width to Hairline
End Sub
The above assumes that the Text box border attributes are originally set to BorderColor 0, Width to Hairline and Special Effects to Flat.

The BorderColor property setting is a numeric exoression that corresponds to the color you want to use for a control's border. The simplest way to find the color numeric expression is to goto the text box's property box and set it to the "hi-lite" color you want there, then check back to see what number is entered in the property box. here's probably a list somewhere, but I've used this type of hack before and don't know where to find it. Also, if you place the cursor over BorderColor and press <F1> Help will show you a more complicated way to set the color using RGB numbers. A control's border color is visible only when its Special Effect is set to Flat or Shadowed.

To use the BorderWidth property, the Secial Effects property must be set to Flat or Shadowed and the Border Style property must not be set to Transparent. The values are 0 for Hairline (the Default) and 1-6 for 1 pt to 6 pts

Afterthought: If you want the border to stay hi-lited until you're thru entering data into the box, you could move the Detail_MouseMove code to the box's LostFocus event instead.
 

Users who are viewing this thread

Back
Top Bottom