Visual Basic Form Login


-Create a form for login. if user click LOGIN, it will be redirect to another form called form2, if they’re click EXIT and program will be terminate.
-Create form2 containing login credentials to authorize users, if users success they will be redirect to another form, called form3 containing CORE Applications. if not valid, users will back in form2 to authorize them.
-Create form3, containing program to calculate triangles and squares. and give a little condition.
Source Code Form1.
  1. Private Sub Command1_Click()  
  2. End  
  3. End Sub  
  4.   
  5. Private Sub Command2_Click()  
  6. Form2.Show  
  7. Form1.Enabled = False  
  8. Form3.Visible = False  
  9.   
  10. End Sub  
Source Code Form2.
  1. Private Sub Command1_Click()  
  2. If Text1.Text = "99999999" And Text2.Text = "rizq" And Text3.Text = "basic" Then  
  3.         Text1.Enabled = False  
  4.         Text2.Enabled = False  
  5.         Text3.Enabled = False  
  6.         Form3.Show  
  7.         Form1.Enabled = False  
  8.         Form2.Enabled = False  
  9.         Command1.Enabled = False  
  10.           
  11.           
  12.     ElseIf Text1.Text = "99999999" And Text2.Text = "rizq" And Text3.Text <> "basic" Then  
  13.           
  14.         Text1.Enabled = False  
  15.         Text2.Enabled = False  
  16.         Command1.Enabled = False  
  17.         MsgBox "User dan NIM Anda Benar, Password Anda salah"  
  18.     ElseIf Text1.Text <> "99999999" And Text2.Text = "rizq" And Text3.Text = "basic" Then  
  19.          
  20.         Text1.Enabled = False  
  21.         Text2.Enabled = False  
  22.         Command1.Enabled = False  
  23.         MsgBox "User dan Password Anda Benar, NIM Anda salah"  
  24.           
  25.     ElseIf Text1.Text = "99999999" And Text2.Text <> "rizq" And Text3.Text = "basic" Then  
  26.          
  27.         Text1.Enabled = False  
  28.         Text2.Enabled = False  
  29.         Command1.Enabled = False  
  30.         MsgBox "User dan Password Anda Benar, USER Anda salah"  
  31.     Else  
  32.         MsgBox "User,NIM dan Passwordnya Salah !"  
  33.         Text1.Text = ""  
  34.         Text2.Text = ""  
  35.         Text3.Text = ""  
  36.           
  37.           
  38.     End If  
  39. End Sub  
  40.   
  41.   
  42.   
  43.   
  44. Private Sub Command2_Click()  
  45. Form1.Show  
  46. Form1.Enabled = True  
  47.   
  48. End Sub  
  49.   
  50. Private Sub Form_Load()  
  51.   
  52. End Sub  
Source Code Form3.
  1. Dim var1 As Single  
  2. Dim var2 As Single  
  3. Dim var4 As Single  
  4. Dim var5 As Single  
  5. Dim hasil1 As Single  
  6. Dim hasil2 As Single  
  7.   
  8. Private Sub Command1_Click()  
  9.   
  10. var1 = Text1.Text  
  11. var2 = Text2.Text  
  12. var3 = 2  
  13. kali = var1 * var2  
  14. hasil1 = kali / 2  
  15. Text3.Text = hasil1  
  16.   
  17.   
  18. If hasil1 < 10 Then  
  19.        MsgBox "SEGITIGA KECIL"  
  20.              
  21.     End If  
  22.   
  23. End Sub  
  24.   
  25. Private Sub Command2_Click()  
  26.   
  27. var4 = Text4.Text  
  28. var5 = Text5.Text  
  29. hasil2 = var4 * var5  
  30. Text6.Text = hasil2  
  31.   
  32.  If hasil2 < 15 Then  
  33.         MsgBox "PERSEGI KECIL"  
  34.              
  35.      End If  
  36. End Sub  
  37.   
  38. Private Sub Command3_Click()  
  39. End  
  40. End Sub  
  41.   
  42. Private Sub Form_Load()  
  43.   
  44. End Sub  
SCREENSHOOT BELOW :
login-auth
apps-form3
apps-2-form3
apps-3-form3
Source code download here

No comments:

Post a Comment