Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace PiotrMrowczynski
  12. {
  13. public partial class LoginControl : UserControl
  14. {
  15.  
  16.  
  17. //Wlasny komponent! We wlasciwosciach mozna ustawic haslo, lub przez przeciazenie konstruktora podac przy tworzeniu jej w kodzie;
  18. string pass;
  19. public string Pass{
  20. get { return pass; }
  21. set { pass = value; }
  22. }
  23. public LoginControl()
  24. {
  25. InitializeComponent();
  26.  
  27.  
  28. }
  29. public LoginControl(string pass)
  30. {
  31. InitializeComponent();
  32. this.pass = pass;
  33.  
  34. }
  35. private void Button1_Click(object sender, EventArgs e)
  36. {
  37. if (Pass.Equals(textBox1.Text))
  38. {
  39. MessageBox.Show("Zalogowano!");
  40. Program.manager.zalogowany = true;
  41. Program.manager.loginWin = false;
  42. this.Hide();
  43. }
  44. else
  45. {
  46. MessageBox.Show("Zle haslo! >>> " + Pass);
  47. }
  48. }
  49.  
  50. private void label1_Click(object sender, EventArgs e)
  51. {
  52. //this.ForeColorChanged("Yellow");
  53. }
  54. }
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement