Senin, 16 Mei 2011

Trik FORM pada Visual Basic 6.0 Bagian 1

R1.      Trik Form Selalu di atas'


 Coding
Double click pada timer kemudia ketikkan kode
Private Sub Timer_Timer()
Form1.show
End sub


1.      Trik Form muncul dari Kanan ke Kiri
Code:
‘Kode Keluar /Close
Private Sub Command1_Click()
Timer2.Interval = 1
End Sub


‘mengatur posisi awal form

Private Sub Form_Load()
Me.Top = (Screen.Height - Height) / 2
Me.Left = (Screen.Width - Width) / 1
Timer1.Interval = 1
End Sub


‘kode form muncul
Private Sub Timer1_Timer()
If Me.Left <= 100 Then
Timer1.Interval = 0
Else
Me.Left = Me.Left - 100
End If
End Sub


‘Kode form keluar
Private Sub Timer2_Timer()
If Me.Left >= Screen.Width Then
Unload Me
Else
Me.Left = Me.Left + 100
End If
End Sub

2.      Trik Form tampil dari Kiri ke Kanan
‘Kode tombol Keluar / Close
Private Sub Command1_Click()
Timer2.Interval = 1
End Sub


‘mengatur posisi awal form
Private Sub Form_Load()
Me.Top = (Screen.Height - Height) / 2
Me.Left = 1
Timer1.Interval = 1
End Sub


‘Kode form untuk  Muncul
Private Sub Timer1_Timer()
If Me.Left >= (Screen.Width - Me.Width) Then
Timer1.Interval = 0
Else
Me.Left = Me.Left + 100
End If
End Sub


‘kode form Untuk Keluar /Unload
Private Sub Timer2_Timer()
If Me.Left <= 100 Then
Unload Me
Else
Me.Left = Me.Left - 100
End If
End Sub

3.      Trik Form Muncul Dari Bawah ke atas
‘Kode form Keluar /Close
Sub Command1_Click()
Timer2.Interval = 1
End Sub


‘mengatur posisi awal form
Private Sub Form_Load()
Me.Left = 100
Me.Top = Screen.Height
Timer1.Interval = 1
End Sub


‘Kode form tampil
Private Sub Timer1_Timer()
If Me.Top <= 10 Then
Timer1.Interval = 0
Else
 Me.Top = Me.Top - 100
End If
End Sub


‘Kode form Keluar/Unload
Private Sub Timer2_Timer()
If Me.Top >= Screen.Height Then
Unload Me
Else
Me.Top = Me.Top + 100
End If
End Sub


Sorce code download di



Trik form pada VB 6.0.zip

1 komentar: