Results 1 to 23 of 23

Thread: Rollover (yes there are others)

  1. #1

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702

    Rollover (yes there are others)

    hey i know they are other posts but they arent exactly what i want, how do i make a rollover image...so i have a button that says music and when they put the mouse over it, i want it to say click me

  2. #2
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    4. Private Declare Function ReleaseCapture Lib "user32" () As Long
    5. Private Declare Function GetCapture Lib "user32" () As Long
    6.  
    7. Private Sub Command1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    8.    
    9.     With Command1
    10.         If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
    11.             Call ReleaseCapture
    12.             .Caption = "Music"
    13.         ElseIf GetCapture() <> .hwnd Then
    14.             Call SetCapture(.hwnd)
    15.             .Caption = "Click Me"
    16.         End If
    17.     End With
    18.  
    19. End Sub

    Assuming you are talking about command buttons.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  3. #3

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    actually imagebox BUT THANKS!

  4. #4
    Hyperactive Member Knowledge_is_Et's Avatar
    Join Date
    Dec 2001
    Location
    An Oak.
    Posts
    305
    Why (and what is) the Capture code?
    Now returning to the world of VB. Please make sure your seatbelts are securely fastened and all trays are in their upright and locked position.

  5. #5
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    It won't work with an imagebox, since it does not provide an hWnd property.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  6. #6
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Originally posted by Knowledge_is_Et
    Why (and what is) the Capture code?
    Set/Get/ReleaseCapture are used to set and tell what window wil receive mouse input. The way its used here is just a VB6 hack to simulate MouseEnter and MouseLeave events.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  7. #7
    Hyperactive Member Knowledge_is_Et's Avatar
    Join Date
    Dec 2001
    Location
    An Oak.
    Posts
    305
    Ah, so I could make events with this code?
    Now returning to the world of VB. Please make sure your seatbelts are securely fastened and all trays are in their upright and locked position.

  8. #8
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Well, yeah, I just did this in a usercontrol recently...
    VB Code:
    1. Option Explicit
    2.  
    3. Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    4. Public Event MouseEnter()
    5. Public Event MouseLeave()
    6.  
    7. Private Declare Function SetCapture Lib "user32" (ByVal hwnd As Long) As Long
    8. Private Declare Function ReleaseCapture Lib "user32" () As Long
    9. Private Declare Function GetCapture Lib "user32" () As Long
    10.  
    11. Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    12.    
    13.     With UserControl
    14.         If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then
    15.             Call ReleaseCapture
    16.             RaiseEvent MouseLeave
    17.         ElseIf GetCapture() <> .hwnd Then
    18.             Call SetCapture(.hwnd)
    19.             RaiseEvent MouseEnter
    20.         Else
    21.             RaiseEvent MouseMove(Button, Shift, X, Y)
    22.         End If
    23.     End With
    24.  
    25. End Sub

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  9. #9
    Hyperactive Member Knowledge_is_Et's Avatar
    Join Date
    Dec 2001
    Location
    An Oak.
    Posts
    305
    well thank you very much, this will be very handy to have around.
    Now returning to the world of VB. Please make sure your seatbelts are securely fastened and all trays are in their upright and locked position.

  10. #10
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    Interesting... I wanted to achieve this a while ago...

    Thanks for telling me how!
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  11. #11
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    No problem, its what I live for.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  12. #12
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    Talking Yay

    Thanks once again.

    I wish I could help you too...
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  13. #13

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    Originally posted by crptcblade
    It won't work with an imagebox, since it does not provide an hWnd property.


    then how did these people make a fancy looking command button...they were like 3d and stuff....and they were image boxes ...i tink...

  14. #14

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    im making a small sized video to show you

  15. #15
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    They are pictureboxes... Anyway, you could always add Form 2.0 controls to your project if you want that kind of controls.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  16. #16
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    It was probably a custom control. Probably a usercontrol with an animation control on it.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  17. #17

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    Originally posted by duc
    im making a small sized video to show you

  18. #18
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    I agree with crptblade about the animation thing. They could have made a custom control and added an animation control on it...

    If you want things like a transparent textbox, picturebox or that kind of things, then add in your components: "Microsoft Forms 2.0 Object Library"
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  19. #19

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702

    Cool movie

    heres the movie
    Attached Files Attached Files

  20. #20
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    That appears to be DirectX or Flash effects.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  21. #21

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    it does, but how did they connect flash and vb commands?!

  22. #22
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    I believe there is a flash ocx from Shockwave. If you don't have it, try looking at www.shockwave.com for a download.
    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  23. #23

    Thread Starter
    Fanatic Member duc's Avatar
    Join Date
    Oct 2002
    Location
    STEAM
    Posts
    702
    ok thanks

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