Forma
2 Timer
1 Label
1Buton (Aç-Kapa butonu)
Ekleyin ve kodu aynen yapıştırıp deneyin.. Umarım işinize yarar. Kod:
Private Sub Command1_Click()
If Label1 = "0" Then
Command1.Caption = "<<<"
Timer1.Enabled = True
Label1 = "1"
Else
Command1.Caption = ">>>"
Timer2.Enabled = True
Label1 = "0"
End If
End Sub
Private Sub Form_Load()
Label1 = "0"
Timer1.Enabled = False
Timer1.Interval = "5"
Timer2.Enabled = False
Timer2.Interval = "5"
Me.Width = 3500
Me.Height = 1200
Command1.Left = 2100
Command1.Top = 120
End Sub
Private Sub Timer1_Timer()
If Form1.Width < 10000 Then
Form1.Width = Form1.Width + 190
Command1.Left = Command1.Left + 190
Else
Timer1.Enabled = False
End If
End Sub
Private Sub Timer2_Timer()
If Form1.Width > 3500 Then
Form1.Width = Form1.Width - 190
Command1.Left = Command1.Left - 190
Else
Timer2.Enabled = False
End If
End Sub