Author : Saeed J.Ghanim
Date Submitted : 1/3/2005
Category : Forms
Compatibility : VB 6
This code has been accessed 7095 times.
Task : A RUNNING COMMAND BUTTON
Declarations
Code
'in the form make the control box=false to make it hard to exit
Private Sub cmd2_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.cmd2.Left = Y * 2 + 900
Me.cmd2.Top = X * 2 + 900
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Command1.Left = Y + 500
Me.Command1.Top = X + 500
End Sub
Private Sub form_load()
App.TaskVisible = False
StartLogging = True
End Sub
Private Sub lblcounter_change()
Select Case Val(Me.lblcounter.Caption)
Case Is = 50
Me.MousePointer = 3
Case Is = 100
Me.MousePointer = 12
Case Is = 150
Me.MousePointer = 15
Case Is = 200
MsgBox "Do You Think Iam Crazy That I Will Let You Click Me"
Me.MousePointer = 1
Case Is = 250
MsgBox "HA Ha Ha,I Know It,You Can Not Do It"
Case Is = 300
MsgBox "You Are Crazy,Click On The X To Exit"
Case Is = 301
Me.cmd2.Visible = True
Case Is = 350
MsgBox "You Are Surrounded"
Case Is = 450
MsgBox "ShutDown Your Pc To Close The Game"
End Select
End Sub
Private Sub Timer1_Timer()
Me.lblcounter.Caption = Val(Me.lblcounter.Caption) + 1
End Sub
Private Sub form_change()
lblcounter_change
End Sub