ضع في الفورم Command1, Timer1, Frame1 وداخل الFram1 ضع Label1
دع قيمة interval لل Timer1 كما هي = 0
Private Sub Command1_Click()
Me.MousePointer = vbHourglass
Timer1.Interval = 100
Command1.Caption = "Going..."
Command1.Enabled = False
End Sub
Private Sub Form_Load()
With Frame1
.BorderStyle = 0
.Left = 0
.Width = Me.Width
.Top = Me.Height / 2
.Height = 200
End With
With Label1
.Caption = ""
.Top = 0
.Left = 0
.Width = 0
.Height = Frame1.Height
.BackColor = vbBlue
End With
Command1.Caption = "Start Bar"
End Sub
Private Sub Timer1_Timer()
With Label1
.Width = .Width + 30
If .Width > Frame1.Width Then
.Width = 0
Timer1.Interval = 0
Command1.Caption = "Start Bar"
Command1.Enabled = True
Me.MousePointer = vbDefault
End If
End With
End Sub