by ^DaRk^ (4 Submissions)
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 3.0
Difficulty: Beginner
Date Added: Wed 3rd February 2021
Rating: (2 Votes)
A lame little "3D" effect with a shape and a command button. makes it look like the button is floating above the form.. the contained code shows how to further that effect by moving the button..
Assumes
You need 1 command button and one shape.
size them both to the same size, fill the shap to a nice shadow color, and place the shape 60 twips right, and 60 twips down from the button..
if you wish the shorten/lengthen the distance, simply play with the numbers; don't forget to remove the border around the shape..
Option Explicit
Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = Command1.Left + 60
Command1.Top = Command1.Top + 60
End Sub
Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Command1.Left = Command1.Left - 60
Command1.Top = Command1.Top - 60
End Sub