Form2.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10. namespace IS_hairdresser
  11. {
  12. public partial class Form2 : Form
  13. {
  14. public Form2()
  15. {
  16. InitializeComponent();
  17. password.PasswordChar = '*';
  18. }
  19. private void button7_Click(object sender, EventArgs e)
  20. {
  21. if (login.Text == "1" && password.Text == "1")
  22. {
  23. Form1 fr = new Form1();
  24. this.Hide();
  25. fr.Show();
  26. }
  27. else
  28. {
  29. label2.Text = "Логин или пароль введён неверно";
  30. }
  31. }
  32. private void password_TextChanged(object sender, EventArgs e)
  33. {
  34. }
  35. private void button1_Click(object sender, EventArgs e)
  36. {
  37. if (password.PasswordChar == '\0')
  38. {
  39. button2.BringToFront();
  40. password.PasswordChar = '*';
  41. }
  42. }
  43. private void button2_Click(object sender, EventArgs e)
  44. {
  45. if(password.PasswordChar == '*')
  46. {
  47. button1.BringToFront();
  48. password.PasswordChar = '\0';
  49. }
  50. }
  51. }
  52. }