Можете ли вы помочь?
Это код дизайна:
[img]https://i. sstatic.net/ZLHdb5fm.png[/img]
Это код:
public partial class Form_LogIn : Form
{
public Form_LogIn()
{
InitializeComponent();
}
private void BtLogin_Click(object sender, EventArgs e)
{
if (TxtUserName.Text == "My_User" && TxtPassword.Text == "My_Password")
{
new FormStart().Show();
this.Hide();
}
else
{
MessageBox.Show("User Name or password incorrect, please verify.");
TxtUserName.Clear();
TxtPassword.Clear();
TxtUserName.Focus();
}
}
private void LblCleanFields_Click(object sender, EventArgs e)
{
TxtUserName.Clear();
TxtPassword.Clear();
}
private void LblExit_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
Это результат моего выполнения:

Можете ли вы указать направление?
Код конструктора форм:
namespace WinFormsApp1
{
partial class Form_LogIn
{
///
/// Required designer variable.
///
private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_LogIn));
pictureBox1 = new PictureBox();
label1 = new Label();
pictureBox2 = new PictureBox();
pictureBox3 = new PictureBox();
pictureBox4 = new PictureBox();
pictureBox5 = new PictureBox();
LblCleanFields = new Label();
BtLogin = new Button();
LblExit = new Label();
TxtUserName = new TextBox();
TxtPassword = new TextBox();
((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBox2).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBox3).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBox4).BeginInit();
((System.ComponentModel.ISupportInitialize)pictureBox5).BeginInit();
SuspendLayout();
//
// pictureBox1
//
resources.ApplyResources(pictureBox1, "pictureBox1");
pictureBox1.Image = Properties.Resources.Logo;
pictureBox1.Name = "pictureBox1";
pictureBox1.TabStop = false;
//
// label1
//
resources.ApplyResources(label1, "label1");
label1.ForeColor = Color.FromArgb(0, 117, 214);
label1.Name = "label1";
//
// pictureBox2
//
resources.ApplyResources(pictureBox2, "pictureBox2");
pictureBox2.Image = Properties.Resources.loging_icon;
pictureBox2.Name = "pictureBox2";
pictureBox2.TabStop = false;
//
// pictureBox3
//
resources.ApplyResources(pictureBox3, "pictureBox3");
pictureBox3.BackColor = Color.FromArgb(0, 117, 214);
pictureBox3.Name = "pictureBox3";
pictureBox3.TabStop = false;
//
// pictureBox4
//
resources.ApplyResources(pictureBox4, "pictureBox4");
pictureBox4.BackColor = Color.FromArgb(0, 117, 214);
pictureBox4.Name = "pictureBox4";
pictureBox4.TabStop = false;
//
// pictureBox5
//
resources.ApplyResources(pictureBox5, "pictureBox5");
pictureBox5.Image = Properties.Resources.Lock;
pictureBox5.Name = "pictureBox5";
pictureBox5.TabStop = false;
//
// LblCleanFields
//
resources.ApplyResources(LblCleanFields, "LblCleanFields");
LblCleanFields.ForeColor = Color.FromArgb(0, 117, 214);
LblCleanFields.Name = "LblCleanFields";
LblCleanFields.Click += LblCleanFields_Click;
//
// BtLogin
//
resources.ApplyResources(BtLogin, "BtLogin");
BtLogin.BackColor = Color.FromArgb(0, 117, 214);
BtLogin.FlatAppearance.BorderSize = 0;
BtLogin.ForeColor = Color.White;
BtLogin.Name = "BtLogin";
BtLogin.UseVisualStyleBackColor = false;
BtLogin.Click += BtLogin_Click;
//
// LblExit
//
resources.ApplyResources(LblExit, "LblExit");
LblExit.ForeColor = Color.FromArgb(0, 117, 214);
LblExit.Name = "LblExit";
LblExit.Click += LblExit_Click;
//
// TxtUserName
//
resources.ApplyResources(TxtUserName, "TxtUserName");
TxtUserName.BorderStyle = BorderStyle.None;
TxtUserName.ForeColor = Color.FromArgb(0, 117, 214);
TxtUserName.Name = "TxtUserName";
//
// TxtPassword
//
resources.ApplyResources(TxtPassword, "TxtPassword");
TxtPassword.BorderStyle = BorderStyle.None;
TxtPassword.ForeColor = Color.FromArgb(0, 117, 214);
TxtPassword.Name = "TxtPassword";
//
// Form_LogIn
//
resources.ApplyResources(this, "$this");
AutoScaleMode = AutoScaleMode.Font;
BackColor = Color.White;
Controls.Add(TxtPassword);
Controls.Add(TxtUserName);
Controls.Add(LblExit);
Controls.Add(BtLogin);
Controls.Add(LblCleanFields);
Controls.Add(pictureBox4);
Controls.Add(pictureBox5);
Controls.Add(pictureBox3);
Controls.Add(pictureBox2);
Controls.Add(label1);
Controls.Add(pictureBox1);
FormBorderStyle = FormBorderStyle.FixedSingle;
Name = "Form_LogIn";
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
((System.ComponentModel.ISupportInitialize)pictureBox2).EndInit();
((System.ComponentModel.ISupportInitialize)pictureBox3).EndInit();
((System.ComponentModel.ISupportInitialize)pictureBox4).EndInit();
((System.ComponentModel.ISupportInitialize)pictureBox5).EndInit();
ResumeLayout(false);
PerformLayout();
}
#endregion
private PictureBox pictureBox1;
private Label label1;
private PictureBox pictureBox2;
private PictureBox pictureBox3;
private PictureBox pictureBox4;
private PictureBox pictureBox5;
private Label LblCleanFields;
private Button BtLogin;
private Label LblExit;
private TextBox TxtUserName;
private TextBox TxtPassword;
}
}
enter code here
enter code here
Подробнее здесь: https://stackoverflow.com/questions/790 ... ut-distort