Advertisement
Guest User

My Code

a guest
Jul 19th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.91 KB | None | 0 0
  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.  
  11. namespace DukeIsabellaMacDonald
  12. {
  13. public partial class SignIn : Form
  14. {
  15. public SignIn()
  16. {
  17. InitializeComponent();
  18. }
  19.  
  20. private void label4_Click(object sender, EventArgs e)
  21. {
  22. private static string SignInUsername = "";
  23. public static string SignInPassword = "";
  24. String username = "Luna101";
  25. private TextBox Username;
  26. private TextBox Password;
  27. private PictureBox pictureBox1;
  28. private Label label1;
  29. private Label label2;
  30. private Button Exit;
  31. private Button Loggin;
  32. String password = "Kat46"; //username and password will change to the users username and password.
  33.  
  34. public static void Main()
  35. {
  36. double Username, Password;
  37.  
  38. try
  39. {
  40. Username = double.Parse(UsernameTextbox.Text);
  41. Password = double.Parse(PasswordTextBox.Text);
  42. }
  43. catch
  44. {
  45. MessageBox.Show("Please Enter Password");
  46. PasswordTextBox.Focus();
  47. PasswordTextBox.SelectAll();
  48.  
  49. }
  50. catch
  51. {
  52. MessageBox.Show("Invalid Username or Password. Please Try Again");
  53. PasswordTextBox.Focus();
  54. UsernameTextBox.Focus();
  55. PasswordTextBox.SelectAll();
  56. UsernameTextBox.Selectall();
  57. }
  58. private void InitializeComponent()
  59. {
  60. System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SignIn));
  61. this.Username = new System.Windows.Forms.TextBox();
  62. this.Password = new System.Windows.Forms.TextBox();
  63. this.pictureBox1 = new System.Windows.Forms.PictureBox();
  64. this.label1 = new System.Windows.Forms.Label();
  65. this.Password = new System.Windows.Forms.Label();
  66. this.Exit = new System.Windows.Forms.Button();
  67. this.Loggin = new System.Windows.Forms.Button();
  68. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
  69. this.SuspendLayout();
  70. //
  71. // textBox1
  72. //
  73. this.Username.Location = new System.Drawing.Point(269, 157);
  74. this.Username.Name = "textBox1";
  75. this.Username.Size = new System.Drawing.Size(197, 26);
  76. this.Username.TabIndex = 0;
  77. //
  78. // textBox2
  79. //
  80. this.Password.Location = new System.Drawing.Point(269, 61);
  81. this.Password.Name = "textBox2";
  82. this.Password.Size = new System.Drawing.Size(197, 26);
  83. this.Password.TabIndex = 1;
  84. //
  85. // pictureBox1
  86. //
  87. this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
  88. this.pictureBox1.Location = new System.Drawing.Point(269, 247);
  89. this.pictureBox1.Name = "pictureBox1";
  90. this.pictureBox1.Size = new System.Drawing.Size(313, 168);
  91. this.pictureBox1.TabIndex = 2;
  92. this.pictureBox1.TabStop = false;
  93. //
  94. // label1
  95. //
  96. this.label1.AutoSize = true;
  97. this.label1.Location = new System.Drawing.Point(124, 61);
  98. this.label1.Name = "label1";
  99. this.label1.Size = new System.Drawing.Size(87, 20);
  100. this.label1.TabIndex = 3;
  101. this.label1.Text = "Username:";
  102. //
  103. // label2
  104. //
  105. this.Password.AutoSize = true;
  106. this.Password.Location = new System.Drawing.Point(124, 157);
  107. this.Password.Name = "label2";
  108. this.Password.Size = new System.Drawing.Size(82, 20);
  109. this.Password.TabIndex = 4;
  110. this.Password.Text = "Password:";
  111. //
  112. // button1
  113. //
  114. this.Exit.Location = new System.Drawing.Point(661, 61);
  115. this.Exit.Name = "button1";
  116. this.Exit.Size = new System.Drawing.Size(99, 50);
  117. this.Exit.TabIndex = 5;
  118. this.Exit.Text = "Exit";
  119. this.Exit.UseVisualStyleBackColor = true;
  120. //
  121. // button2
  122. //
  123. this.Loggin.Location = new System.Drawing.Point(661, 157);
  124. this.Loggin.Name = "button2";
  125. this.Loggin.Size = new System.Drawing.Size(99, 53);
  126. this.Loggin.TabIndex = 6;
  127. this.Loggin.Text = "Loggin";
  128. this.Loggin.UseVisualStyleBackColor = true;
  129. //
  130. // SignIn
  131. //
  132. this.ClientSize = new System.Drawing.Size(883, 427);
  133. this.Controls.Add(this.Loggin);
  134. this.Controls.Add(this.Exit);
  135. this.Controls.Add(this.Password);
  136. this.Controls.Add(this.label1);
  137. this.Controls.Add(this.pictureBox1);
  138. this.Controls.Add(this.Password);
  139. this.Controls.Add(this.Username);
  140. this.Name = "SignIn";
  141. this.Text = "Sign In";
  142. ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
  143. ResumeLayout(false);
  144. PerformLayout();
  145.  
  146. }
  147. }
  148. }
  149. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement