Tools Links Login

Back to simplicity: Floating CommandButtons

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..

Original Author: ^DaRk^

Assumptions

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..

Code

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

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 92 times

Categories

Visual Basic 6

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.