ConPanelLogin.cs 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows.Forms;
  7. namespace ErgometerDoctorApplication
  8. {
  9. public class ConPanelLogin:Panel
  10. {
  11. MainWindow mainWindow;
  12. public ConPanelLogin(Form mainWindow) : base()
  13. {
  14. this.mainWindow = (MainWindow)mainWindow;
  15. this.textBoxPassword = new System.Windows.Forms.TextBox();
  16. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  17. this.buttonLogin = new System.Windows.Forms.Button();
  18. this.labelPassword = new System.Windows.Forms.Label();
  19. this.labelLoginInfo = new System.Windows.Forms.Label();
  20. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  21. //
  22. // Container
  23. //
  24. this.BackColor = System.Drawing.Color.White;
  25. this.Controls.Add(this.labelLoginInfo);
  26. this.Controls.Add(this.labelPassword);
  27. this.Controls.Add(this.buttonLogin);
  28. this.Controls.Add(this.pictureBox1);
  29. this.Controls.Add(this.textBoxPassword);
  30. this.Dock = System.Windows.Forms.DockStyle.Fill;
  31. this.Location = new System.Drawing.Point(0, 0);
  32. //
  33. // textBoxPassword
  34. //
  35. this.textBoxPassword.Anchor = System.Windows.Forms.AnchorStyles.None;
  36. this.textBoxPassword.Location = new System.Drawing.Point(15, 70);
  37. this.textBoxPassword.Name = "textBoxPassword";
  38. this.textBoxPassword.PasswordChar = '*';
  39. this.textBoxPassword.Size = new System.Drawing.Size(150, 20);
  40. this.textBoxPassword.TabIndex = 0;
  41. this.textBoxPassword.KeyDown += TextBoxPassword_KeyDown;
  42. //
  43. // pictureBox1
  44. //
  45. this.pictureBox1.Image = ((System.Drawing.Image)Properties.Resources.imageDoctor);
  46. this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.None;
  47. this.pictureBox1.Location = new System.Drawing.Point(0, -150);
  48. this.pictureBox1.Name = "pictureBox1";
  49. this.pictureBox1.Size = new System.Drawing.Size(175, 175);
  50. this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
  51. //
  52. // buttonLogin
  53. //
  54. this.buttonLogin.Anchor = System.Windows.Forms.AnchorStyles.None;
  55. this.buttonLogin.BackColor = System.Drawing.SystemColors.Highlight;
  56. this.buttonLogin.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
  57. this.buttonLogin.Font = new System.Drawing.Font("Segoe UI Semibold", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  58. this.buttonLogin.ForeColor = System.Drawing.Color.White;
  59. this.buttonLogin.Location = new System.Drawing.Point(15, 105);
  60. this.buttonLogin.Name = "buttonLogin";
  61. this.buttonLogin.Size = new System.Drawing.Size(150, 30);
  62. this.buttonLogin.TabIndex = 2;
  63. this.buttonLogin.Text = "Log In";
  64. this.buttonLogin.UseVisualStyleBackColor = false;
  65. this.buttonLogin.Click += new System.EventHandler(this.buttonLogin_Click);
  66. //
  67. // labelPassword
  68. //
  69. this.labelPassword.Anchor = System.Windows.Forms.AnchorStyles.None;
  70. this.labelPassword.AutoSize = true;
  71. this.labelPassword.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  72. this.labelPassword.Location = new System.Drawing.Point(11, 40);
  73. this.labelPassword.Name = "labelPassword";
  74. this.labelPassword.Size = new System.Drawing.Size(103, 21);
  75. this.labelPassword.TabIndex = 3;
  76. this.labelPassword.Text = "Wachtwoord";
  77. //
  78. // labelLoginInfo
  79. //
  80. this.labelLoginInfo.Anchor = System.Windows.Forms.AnchorStyles.None;
  81. this.labelLoginInfo.AutoSize = true;
  82. this.labelLoginInfo.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
  83. this.labelLoginInfo.ForeColor = System.Drawing.Color.Red;
  84. this.labelLoginInfo.Location = new System.Drawing.Point(11, 140);
  85. this.labelLoginInfo.Name = "labelLoginInfo";
  86. this.labelLoginInfo.Size = new System.Drawing.Size(103, 21);
  87. this.labelLoginInfo.TabIndex = 4;
  88. this.labelLoginInfo.Text = "";
  89. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  90. }
  91. private void TextBoxPassword_KeyDown(object sender, KeyEventArgs e)
  92. {
  93. if (e.KeyCode == Keys.Enter)
  94. {
  95. buttonLogin_Click(this, new EventArgs());
  96. }
  97. }
  98. private void buttonLogin_Click(object sender, EventArgs e)
  99. {
  100. mainWindow.validateLogin();
  101. }
  102. public System.Windows.Forms.TextBox textBoxPassword;
  103. private PictureBox pictureBox1;
  104. private System.Windows.Forms.Button buttonLogin;
  105. private System.Windows.Forms.Label labelPassword;
  106. public System.Windows.Forms.Label labelLoginInfo;
  107. }
  108. }