Results 1 to 9 of 9

Thread: [RESOLVED] Mouseover

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    196

    Resolved [RESOLVED] Mouseover

    I have picures for my buttons. "cmdbutton" property has a picture. So first how do I make it so when i move my mouse over the button i get the little popup that tells you what the button is. Like for a send button, when I move the mouse over it it show a bubble that says "send mail". with like a second delay.

    also how do i make is so that when the mouse is over the button, the cursor will change?

  2. #2
    Hyperactive Member Teseng's Avatar
    Join Date
    Sep 2007
    Location
    Tupelo, MS
    Posts
    281

    Re: Mouseover

    The first part, I belive you want a ToolTip, to do that you just change the picture/button's property "ToolTipText" to whatever you want, and it will popup after a second or so of hovering over it.

    For the cursor change, buttons and pictures also have the"MouseIcon" and "MousePointer" properties you can set, so when the mouse is over it, the cursor changes to whatever you specify in the property.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    196

    Re: Mouseover

    Thanks, i appreciate it.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    196

    Re: [RESOLVED] Mouseover

    Ok actually a set the mpuse pointer properties to custom and the mouse icon properties to the icon I wanted and rean and compiled the program and it doesnt work. Nothing happens. However the tool tip thing worked great.

  5. #5
    Hyperactive Member Teseng's Avatar
    Join Date
    Sep 2007
    Location
    Tupelo, MS
    Posts
    281

    Re: [RESOLVED] Mouseover

    Hmmm, i tested and setting the Mousepointer to 99 (custom) and loading the proper .ico file into the MouseIcon property at design time, it works fine for me.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    196

    Re: [RESOLVED] Mouseover

    ok so you said:
    loading the proper .ico file into the MouseIcon property at design time, it works fine for me
    What is a "proper" Icon? because i did a .ico search and just loaded one from my comp.

  7. #7
    Hyperactive Member Teseng's Avatar
    Join Date
    Sep 2007
    Location
    Tupelo, MS
    Posts
    281

    Re: [RESOLVED] Mouseover

    i loaded a 32x32 ico file, when i said proper i just meant the one that I wanted. I cant understand why it wont work for you

  8. #8

    Thread Starter
    Addicted Member
    Join Date
    Aug 2006
    Posts
    196

    Re: [RESOLVED] Mouseover

    where did you get your icons from?

  9. #9
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [RESOLVED] Mouseover

    Try something like this
    Code:
    Option Explicit
    
    Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    Private Declare Function ReleaseCapture Lib "user32" () As Long
    Private Declare Function GetCapture Lib "user32" () As Long
    
    Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If (X < 0) Or (Y < 0) Or (X > Command1.Width) Or (Y > Command1.Height) Then
           ReleaseCapture
           Command1.MousePointer = 0 'default
    ElseIf GetCapture() <> Command1.hwnd Then
           SetCapture Command1.hwnd
           Command1.MousePointer = 6 'size ne sw
    End If
    End Sub

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