UI Material design form membuat input data - Form
Textbox1 = nama depan Textbox2 = nama belakang
Textbox3 = alamat lengkap
Textbox4 = kota
Label1 = caption nama depan
Label2 = caption nama belakang
Label3 = caption alamat lengkap
Label4 = caption kota
Label5 = caption Simpan
Label10 = caption Keluar
UI Material design form membuat input data - Kode macro Pengaturan Userform
#If Win32 Then Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Const WS_SYSMENU = &H80000 Const GWL_STYLE = (-16)#Else Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Const WS_SYSMENU = &H80000 Const GWL_STYLE = (-16)#End If
#If Win32 Then
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const WS_SYSMENU = &H80000
Const GWL_STYLE = (-16)
#Else
Private Declare PtrSafe Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Const WS_SYSMENU = &H80000
Const GWL_STYLE = (-16)
#End If
UI Material design form membuat input data - Kode macro Pengaturan Userform saat aktif
Private Sub UserForm_Activate()On Error Resume NextDim hWnd, lStyle As LonghWnd = FindWindow("ThunderDFrame", Me.Caption)lStyle = GetWindowLong(hWnd, GWL_STYLE)SetWindowLong hWnd, GWL_STYLE, lStyle And Not WS_SYSMENUEnd Sub
UI Material design form membuat input data - Kode macro Pengaturan Userform pointer
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)Label10.ForeColor = &H24DBFBLabel10.Font.Bold = FalseLabel5.ForeColor = &H0&Label5.Font.Bold = FalseEnd Sub
Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Label10.ForeColor = &H24DBFB
Label10.Font.Bold = False
Label5.ForeColor = &H0&
Label5.Font.Bold = False
End Sub
UI Material design form membuat input data - Kode macro Pengaturan Userform klik
Private Sub UserForm_Click()TextBox1.BackColor = &H525542TextBox2.BackColor = &H525542TextBox3.BackColor = &H525542TextBox4.BackColor = &H525542End Sub
Private Sub UserForm_Click()
TextBox1.BackColor = &H525542
TextBox2.BackColor = &H525542
TextBox3.BackColor = &H525542
TextBox4.BackColor = &H525542
End Sub
UI Material design form membuat input data - Kode macro Textbox aktif / tidak akktif
Private Sub TextBox1_Enter()TextBox1.BackColor = &H678B43End SubPrivate Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)TextBox1.BackColor = &H525542End SubPrivate Sub TextBox2_Enter()TextBox2.BackColor = &H678B43End SubPrivate Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)TextBox3.BackColor = &H525542End SubPrivate Sub TextBox4_Enter()TextBox4.BackColor = &H678B43End SubPrivate Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)TextBox4.BackColor = &H525542End SubPrivate Sub TextBox3_Enter()TextBox3.BackColor = &H678B43End SubPrivate Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)TextBox2.BackColor = &H525542End Sub
UI Material design form membuat input data - Kode macro Label keluar
Private Sub Label10_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)Label10.ForeColor = &H152EDBLabel10.Font.Bold = TrueEnd Sub
UI Material design form membuat input data - Kode macro Label simpan
Private Sub Label5_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)Label5.ForeColor = &H678B43Label5.Font.Bold = TrueEnd Sub