Results 1 to 6 of 6

Thread: mouseover

  1. #1

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    Is it possible to have a mouseover effect.
    ie..if mouse over opt.caption = "This works"
    mouse off opt.caption = ""
    If so...how?

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  2. #2
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    one way i used one time was to use to position and size of my control, say a command button, then when the mouse coords were in that range, i had the appropiate action happen.

  3. #3

    Thread Starter
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    simple mouse overs

    I stumbled over this trying different things..
    it's all so simple in hindsight

    Mousemove event on form opt.caption = ""
    Mousemove event on option button opt.caption = "This works"

    too easy to think of...

    thanks billrogers for the spark that ignited the flame.

    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  4. #4
    Member
    Join Date
    May 2000
    Location
    Mansfield Texas
    Posts
    36
    Code:
    'when mouse moves over label caption is thisworks
    Private Sub Label1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Label1.caption="thisworks"
    end sub
    
    
    
    Private Function MouseOff()
    Label1.caption = ""
    'if you have more thatn one lable add them here
    End Function
    
    
    
    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    MouseOff
    End Sub
    Charlie Staton
    14 y/o
    I don't smoke, I don't drink, and I don't assosciate with pokemon.

  5. #5
    Hyperactive Member
    Join Date
    May 2000
    Posts
    367
    that is a real easy way to do it, nice job. I like that idea.

    Thanks HeSaidJoe

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    Declare Function GetWindowRect Lib "user32" Alias "GetWindowRect" (ByVal hwnd As Long, lpRect As RECT) As Long
    Declare Function GetCursorPos Lib "user32" Alias "GetCursorPos" (lpPoint As POINTAPI) As Long
    Type POINTAPI
            x As Long
            y As Long
    End Type
    Type RECT
            Left As Long
            Top As Long
            Right As Long
            Bottom As Long
    End Type
    Actually this is done by getting the rect of your control (if you're making a usercontrol) and then get the position of mouse and then look if the point is inside the rect. If it is it's entered, if it's not, it's exited. You need to use a timer for this so have your timer only active when the cursor is inside, and let the mousemove event triggers the mouseenter event
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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