Добавление кнопки

This commit is contained in:
Slivin
2026-01-28 16:02:24 +03:00
parent bc123becf7
commit bf4f1cd6b4
2 changed files with 18 additions and 0 deletions
+13
View File
@@ -29,6 +29,7 @@
private void InitializeComponent()
{
label1 = new Label();
button1 = new Button();
SuspendLayout();
//
// label1
@@ -40,11 +41,22 @@
label1.TabIndex = 0;
label1.Text = "SLIVIN";
//
// button1
//
button1.Location = new Point(311, 239);
button1.Name = "button1";
button1.Size = new Size(75, 23);
button1.TabIndex = 1;
button1.Text = "нажать";
button1.UseVisualStyleBackColor = true;
button1.Click += button1_Click;
//
// Form1
//
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(784, 561);
Controls.Add(button1);
Controls.Add(label1);
Name = "Form1";
Text = "Form1";
@@ -55,5 +67,6 @@
#endregion
private Label label1;
private Button button1;
}
}
+5
View File
@@ -6,5 +6,10 @@ namespace Slivin_PR03_GIT
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(DateTime.Now.ToString());
}
}
}