Results 1 to 7 of 7

Thread: And what about mouseout ?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    How can I mimic a mouseout event concerning a label. There is that mouseover event that will handle the "mousein" but what then ?

  2. #2
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    Post

    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).]

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    I haven't tried your code yet, but I don't fully understand it. What has the mousebutton got to do with my question??

  4. #4
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    Post

    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.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Oct 1999
    Posts
    309

    Post

    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...

  6. #6
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    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]

  7. #7
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    Post

    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
  •  



Click Here to Expand Forum to Full Width