Nov 15th, 2002, 08:47 PM
#1
Thread Starter
Fanatic Member
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
Nov 15th, 2002, 08:52 PM
#2
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.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
Nov 15th, 2002, 08:53 PM
#3
Thread Starter
Fanatic Member
actually imagebox BUT THANKS!
Nov 15th, 2002, 08:54 PM
#4
Hyperactive Member
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.
Nov 15th, 2002, 08:55 PM
#5
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
Nov 15th, 2002, 08:57 PM
#6
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
Nov 15th, 2002, 08:59 PM
#7
Hyperactive Member
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.
Nov 15th, 2002, 09:06 PM
#8
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
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
Nov 15th, 2002, 09:09 PM
#9
Hyperactive Member
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.
Nov 15th, 2002, 09:11 PM
#10
Frenzied Member
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
Nov 15th, 2002, 09:13 PM
#11
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
Nov 15th, 2002, 09:18 PM
#12
Frenzied Member
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
Nov 15th, 2002, 09:37 PM
#13
Thread Starter
Fanatic Member
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...
Nov 15th, 2002, 09:39 PM
#14
Thread Starter
Fanatic Member
im making a small sized video to show you
Nov 15th, 2002, 09:40 PM
#15
Frenzied Member
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
Nov 15th, 2002, 09:40 PM
#16
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
Nov 15th, 2002, 09:42 PM
#17
Thread Starter
Fanatic Member
Originally posted by duc
im making a small sized video to show you
Nov 15th, 2002, 09:47 PM
#18
Frenzied Member
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
Nov 15th, 2002, 10:24 PM
#19
Thread Starter
Fanatic Member
movie
Attached Files
Nov 15th, 2002, 10:43 PM
#20
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
Nov 15th, 2002, 11:02 PM
#21
Thread Starter
Fanatic Member
it does, but how did they connect flash and vb commands?!
Nov 15th, 2002, 11:03 PM
#22
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
Nov 15th, 2002, 11:07 PM
#23
Thread Starter
Fanatic Member
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width