Advertisement
Guest User

Untitled

a guest
Feb 25th, 2020
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. Public Class Form1
  2.  
  3. Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  4. With ListBox1.Items
  5. .Add("ani")
  6. .Add("bobi")
  7. .Add("dimo")
  8. .Add("ivan")
  9. .Add("mimi")
  10. End With
  11. With ListBox2.Items
  12. .Add("1111")
  13. .Add("2222")
  14. .Add("3333")
  15. .Add("4444")
  16. .Add("5555")
  17. End With
  18. 'lstIme.Hide()
  19. 'lstPas.Hide()
  20. End Sub
  21.  
  22. Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  23. Dim i As Integer
  24. Dim x As Integer
  25. Dim blnExists As Boolean
  26.  
  27. If TextBox1.Text <> "" And blnExists = False Then
  28. TextBox1.Text = ""
  29. TextBox2.Text = ""
  30. MsgBox("НЕВАЛИДНО ПОТРЕБИТЕЛСКО ИМЕ", vbInformation, "Съобщение")
  31. End If
  32.  
  33.  
  34. For i = 0 To ListBox1.Items.Count() - 1
  35. For x = 0 To ListBox2.Items.Count() - 1
  36. If TextBox1.Text = ListBox1.Items(i) Then
  37. ElseIf TextBox2.Text = ListBox2.Items(x) Then
  38. MsgBox("ПОЗДРАВИ за", vbExclamation, "СЪОБЩЕНИЕ")
  39. Exit For
  40. Else
  41. MsgBox("НЕВАЛИДНА ПАРОЛА", vbExclamation, "СЪОБЩЕНИЕ")
  42. Exit For
  43. End If
  44. Next
  45. Next
  46. End Sub
  47.  
  48. Private Sub CheckBox1_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged
  49. If CheckBox1.Checked = True Then
  50. TextBox2.PasswordChar = ""
  51. Else
  52. TextBox2.PasswordChar = "*"
  53. End If
  54. End Sub
  55.  
  56. Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
  57. TextBox1.Clear()
  58. TextBox2.Clear()
  59. End Sub
  60. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement