Powered by Blogger.

PROGRAM TIMER EVENT EXAMPLE - CONTOH


Timer Event Example |

This example demonstrates a digital clock. To try this example, paste the code into the Declarations section of a form that contains a Label control and a Timer control, and then press F5.

Private Sub Form_Load ()
   Timer1.Interval = 1000   ' Set Timer interval.
End Sub

Private Sub Timer1_Timer ()
   Label1.Caption = Time   ' Update time display.
End Sub

This example moves a PictureBox control across a form. To try this example, paste the code into the Declarations section of a form that contains a Timer control and a PictureBox control, and then press F5. For a better visual effect you can assign a bitmap to the PictureBox using the Picture property.

Dim DeltaX, DeltaY As Integer   ' Declare variables.
Private Sub Timer1_Timer ()
   Picture1.Move Picture1.Left + DeltaX, Picture1.Top + DeltaY
   If Picture1.Left < ScaleLeft Then DeltaX = 100
   If Picture1.Left + Picture1.Width > ScaleWidth + ScaleLeft Then
      DeltaX = -100
   End If
   If Picture1.Top < ScaleTop Then DeltaY = 100
   If Picture1.Top + Picture1.Height > ScaleHeight + ScaleTop Then
      DeltaY = -100
   End If
End Sub

Private Sub Form_Load ()
   Timer1.Interval = 1000   ' Set Interval.
   DeltaX = 100   ' Initialize variables.
   DeltaY = 100
End Sub





Okay ulasan yang lain sedang menunggu coba anda lihat  program perintah sql serta auto search  dan 
program mengembalikan variable
Program Mencari Karakter

Anda baru saja membaca artikel yang berkategori Latihan vb 6 dengan judul PROGRAM TIMER EVENT EXAMPLE - CONTOH. Anda bisa bookmark halaman ini dengan URL http://belajar-dgn-vb.blogspot.com/2012/07/program-timer-event-example-contoh.html. Terima kasih!
Ditulis oleh: Unknown - Saturday 7 July 2012

Belum ada komentar untuk "PROGRAM TIMER EVENT EXAMPLE - CONTOH"

Post a Comment