Click to See Complete Forum and Search --> : And what about mouseout ?
Inhumanoid
Nov 1st, 1999, 02:13 AM
How can I mimic a mouseout event concerning a label. There is that mouseover event that will handle the "mousein" but what then ?
Evan
Nov 1st, 1999, 02:17 AM
Thats Simply ...
In the General :
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Const MOUSEEVENTF_LEFTDOWN = &H2
Const MOUSEEVENTF_LEFTUP = &H4
Const MOUSEEVENTF_MIDDLEDOWN = &H20
Const MOUSEEVENTF_MIDDLEUP = &H40
Const MOUSEEVENTF_MOVE = &H1
Const MOUSEEVENTF_ABSOLUTE = &H8000
Const MOUSEEVENTF_RIGHTDOWN = &H8
Const MOUSEEVENTF_RIGHTUP = &H10
In the Form :
mouse_event MOUSEEVENTF_LEFTDOWN ' left button down
mouse_event MOUSEEVENTF_LEFTUP ' Left Button up
That Help at all?
[This message has been edited by Evan (edited 11-01-1999).]
Inhumanoid
Nov 1st, 1999, 02:30 AM
I haven't tried your code yet, but I don't fully understand it. What has the mousebutton got to do with my question??
Evan
Nov 1st, 1999, 03:00 AM
Ok,
I think what you want to do Is to mimic the clicking of a mouse button on a label, Which You Just need that code them Some code to move the position of the move to your form .. I dont know a easier way to do that..
explain yourself better please.
Inhumanoid
Nov 1st, 1999, 03:12 AM
I probably did not explain it well enough...
(sorry about that folks)
I want my label to change borderstyle and color when the mouse is on the label and change it back when the mouse is not on the label...
Aaron Young
Nov 1st, 1999, 03:35 AM
Try creating your own Label Class, here's a quick example, you can improve it for your own needs..
In a Class Module Called HyperLink..
Public WithEvents Label As Label
Private Sub Label_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If TypeName(oLastLabel) = "Nothing" Then
Set oLastLabel = Label
Label.ForeColor = vbBlue
Label.FontUnderline = True
End If
End Sub
In a Module..
Public oLastLabel As Control
In the Form, Add 3 Labels..
Private Link1 As New HyperLink
Private Link2 As New HyperLink
Private Link3 As New HyperLink
Private Sub Form_Load()
Set Link1.Label = Label1
Set Link2.Label = Label2
Set Link3.Label = Label3
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If TypeName(oLastLabel) = "Nothing" Then Exit Sub
oLastLabel.ForeColor = vbWindowText
oLastLabel.FontUnderline = False
Set oLastLabel = Nothing
End Sub
Private Sub Label1_Click()
'Play Code to Jump to URL in Label1 Here..
End Sub
------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
adyoung@win.bright.net
Evan
Nov 1st, 1999, 05:53 AM
lol,
WELL , That was ALOT easier with out all the hastle.. I see where you were going now :)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.