|
-
Nov 1st, 1999, 03:13 AM
#1
Thread Starter
Hyperactive Member
How can I mimic a mouseout event concerning a label. There is that mouseover event that will handle the "mousein" but what then ?
-
Nov 1st, 1999, 03:17 AM
#2
Frenzied Member
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).]
-
Nov 1st, 1999, 03:30 AM
#3
Thread Starter
Hyperactive Member
I haven't tried your code yet, but I don't fully understand it. What has the mousebutton got to do with my question??
-
Nov 1st, 1999, 04:00 AM
#4
Frenzied Member
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.
-
Nov 1st, 1999, 04:12 AM
#5
Thread Starter
Hyperactive Member
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...
-
Nov 1st, 1999, 04:35 AM
#6
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..
Code:
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..
Code:
Public oLastLabel As Control
In the Form, Add 3 Labels..
Code:
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
[email protected]
[email protected]
-
Nov 1st, 1999, 06:53 AM
#7
Frenzied Member
lol,
WELL , That was ALOT easier with out all the hastle.. I see where you were going now
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|