Professional Documents
Culture Documents
Coding Tips Userform
Coding Tips Userform
FULL SCREEN
Application.WindowState = xlMaximized
Me.Height = Application.Height
Me.Width = Application.Width
Me.Left = 0
Me.Top = 0
KELUAR
stopped = True
Unload Me
n = Len(Q)
Cpt = Q
Awal:
DoEvents
jam = FormatDateTime(Time, vbLongTime)
If stopped = True Then Exit Sub
Me.Caption = Right(Cpt, n)
n=n+1
If n = (Len(Q) + 100) Then n = 0
ZOOM
Private Sub SpinButton1_Change()
Me.text_Zoom.Value = Me.SpinButton1.Value
End Sub
TeksAnimasi
Me.SpinButton1.Value = 100
Me.text_Zoom.Value = 100
End Sub
DISABLE EXIT
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
If CloseMode = 0 Then
Cancel = True
MsgBox "Gunakan tombol keluar bosku", vbCritical, "Information"
End If
End Sub
Private Sub TextBox1_Enter()
If Me.TextBox1.Value = "Nama" Then
Me.TextBox1.Value = " "
End If
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Me.TextBox1.Value = " " Then
Me.TextBox1.Value = "Nama"
End If
End Sub
WATERMARK
Private Sub TextBox2_Enter()
If Me.TextBox2.Value = "Alamat" Then
Me.TextBox2.Value = " "
End If
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
If Me.TextBox2.Value = " " Then
Me.TextBox2.Value = "Alamat"
End If
End Sub