UI Material design form membuat input data

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

UI Material design form membuat input data - Kode macro Pengaturan Userform saat aktif

Private Sub UserForm_Activate()
On Error Resume Next
Dim hWnd, lStyle As Long
hWnd = FindWindow("ThunderDFrame", Me.Caption)
lStyle = GetWindowLong(hWnd, GWL_STYLE)
SetWindowLong hWnd, GWL_STYLE, lStyle And Not WS_SYSMENU
End 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 = &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 = &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 = &H678B43
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.BackColor = &H525542
End Sub
Private Sub TextBox2_Enter()
TextBox2.BackColor = &H678B43
End Sub
Private Sub TextBox3_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox3.BackColor = &H525542
End Sub
Private Sub TextBox4_Enter()
TextBox4.BackColor = &H678B43
End Sub
Private Sub TextBox4_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox4.BackColor = &H525542
End Sub
Private Sub TextBox3_Enter()
TextBox3.BackColor = &H678B43
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox2.BackColor = &H525542
End 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 = &H152EDB
Label10.Font.Bold = True
End 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 = &H678B43
Label5.Font.Bold = True
End Sub

LIHAT TUTORIALNYA DI YT EXCEL HOME