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
Printable View
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
VB 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) With Command1 If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then Call ReleaseCapture .Caption = "Music" ElseIf GetCapture() <> .hwnd Then Call SetCapture(.hwnd) .Caption = "Click Me" End If End With End Sub
Assuming you are talking about command buttons.
actually imagebox BUT THANKS!
Why (and what is) the Capture code?
It won't work with an imagebox, since it does not provide an hWnd property.
;)
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.Quote:
Originally posted by Knowledge_is_Et
Why (and what is) the Capture code?
:)
Ah, so I could make events with this code?
Well, yeah, I just did this in a usercontrol recently...
VB Code:
Option Explicit Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Public Event MouseEnter() Public Event MouseLeave() 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 UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) With UserControl If (X < 0) Or (Y < 0) Or (X > .Width) Or (Y > .Height) Then Call ReleaseCapture RaiseEvent MouseLeave ElseIf GetCapture() <> .hwnd Then Call SetCapture(.hwnd) RaiseEvent MouseEnter Else RaiseEvent MouseMove(Button, Shift, X, Y) End If End With End Sub
:)
well thank you very much, this will be very handy to have around.
Interesting... I wanted to achieve this a while ago... :)
Thanks for telling me how!
No problem, its what I live for.
;)
Thanks once again. :)
:rolleyes: I wish I could help you too...
Quote:
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...
im making a small sized video to show you
They are pictureboxes... Anyway, you could always add Form 2.0 controls to your project if you want that kind of controls.
It was probably a custom control. Probably a usercontrol with an animation control on it.
Quote:
Originally posted by duc
im making a small sized video to show you
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"
heres the movie
That appears to be DirectX or Flash effects.
it does, but how did they connect flash and vb commands?!
I believe there is a flash ocx from Shockwave. If you don't have it, try looking at www.shockwave.com for a download.
ok thanks