Contoh Materi Membuat form Muncul dari tengah dengan animasi membesar
Copy paste code dibawah ini
Private Sub Form_Load()
Me.Height = 10
Me.Width = 10
End Sub
Private Sub Timer1_Timer()
Me.Height = Me.Height + 100
Tengah
If Me.Height >= 3000 Then '3000 tergantung height form yg di inginkan
Timer1.Enabled = False
Tengah
End If
Me.Width = Me.Width + 100
Tengah
If Me.Width >= 4000 Then
Timer1.Enabled = False
Tengah
End If
End Sub
Public Sub Tengah()
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
End Sub
Materi 2. Menutup Form ke kanan
copy code dibawah ini
'klo top semua akan tutup diagonal kebawah
' Klo Me.Top = Me.Top - 40 (min) akan ke atas/kiri
Private Sub Command1_Click()
Do
Me.Left = Me.Left + 40
Me.Move Me.Left, Me.Top
DoEvents
Loop Until Me.Left > Screen.Width
'klo loop until < (kurangdari) maka akan bergerak
End Sub
'Ketika Button X Close di klik maka form akan di tutup kekanan
Private Sub Form_Unload(Cancel As Integer)
Do
Me.Left = Me.Left + 40
Me.Move Me.Left, Me.Top
DoEvents
Loop Until Me.Left > Screen.Width
End Sub
Tuliskan Pertanyaan anda tentang Vissual Basic di fb comment