|
-
Oct 11th, 2000, 11:47 AM
#1
Thread Starter
Hyperactive Member
Hi,
I have an image control in my vb project, and I want it to act as a button. There will be 3 images in the image control at different times.
When the cursor is not near the image, there is image 1.
When the cursor is over the image, there is image 2.
When the cursor is pressed over the image, it changes to image 3 for the brief period that the mouse has been clicked.
Then it changes back to image 2 - or 1, if the user takes the cursor off the image.
I know it has something to do with mouseover etc, but I'm not sure of the code.
Could somebody help me?
Thanks!
-
Oct 11th, 2000, 12:03 PM
#2
Frenzied Member
Something like this
Code:
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
image1.picture = image3.picture
End Sub
Private Sub Image1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
image1.picture = image1.picture
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
image1.picture = image2.picture
End Sub
-
Oct 11th, 2000, 12:05 PM
#3
Fanatic Member
Try this
Code:
Option Explicit
Private Sub Form_Load()
ChDrive "C:\"
ChDir "C:\Program Files\Microsoft Visual Studio\Common\Graphics\Icons\Misc\"
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Picture = LoadPicture("FACE02.ICO")
End Sub
Private Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Picture = LoadPicture("FACE03.ICO")
End Sub
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Image1.Picture = LoadPicture("FACE01.ICO")
End Sub
Chemically Formulated As:
Dr. Nitro
-
Oct 11th, 2000, 12:06 PM
#4
Fanatic Member
Sorry Vlatko! I didn't realize you posted already.
Chemically Formulated As:
Dr. Nitro
-
Oct 11th, 2000, 12:10 PM
#5
Thread Starter
Hyperactive 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
|