There are two forms. The first one(form1) has a command button. When you click it, it calls the second form(form2) using this code:
In form2 there are two picture boxes. The first one(pic1) is visible, the second(pic2) is not. When the mouse hovers pic1:
This will give the feeling of a hover effect, using two pictures.
But when I test it, the whole project unloads.
Why does this happen? How can it be solve? Thanks.
Code:
form2.show
Code:
Private Sub pic1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
SetCursor LoadCursor(0, IDC_HAND)
End Sub
Code:
Private Sub pic1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
pic1.Visible = True
pic2.Visible = False
unload me
End Sub
Code:
Private Sub pic1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
pic1.Visible = False
pic2.Visible = True
End Sub
But when I test it, the whole project unloads.
Why does this happen? How can it be solve? Thanks.