можно удалять персонажей из списка

This commit is contained in:
Zifrkoks 2018-04-10 16:16:50 +03:00 committed by GitHub
parent 50fad066df
commit 001fc94011
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 9 deletions

View file

@ -41,6 +41,7 @@ namespace WindowsFormsApplication1
this.panel2 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel();
this.SaveCharButton = new System.Windows.Forms.Button(); this.SaveCharButton = new System.Windows.Forms.Button();
this.panel3 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel();
this.openSpace = new System.Windows.Forms.PictureBox();
this.SpriteNumberLabel = new System.Windows.Forms.Label(); this.SpriteNumberLabel = new System.Windows.Forms.Label();
this.SpriteNumberTextBox = new System.Windows.Forms.TextBox(); this.SpriteNumberTextBox = new System.Windows.Forms.TextBox();
this.OpenButton = new System.Windows.Forms.Button(); this.OpenButton = new System.Windows.Forms.Button();
@ -59,7 +60,6 @@ namespace WindowsFormsApplication1
this.ButtonAddChar = new System.Windows.Forms.Button(); this.ButtonAddChar = new System.Windows.Forms.Button();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.openSpace = new System.Windows.Forms.PictureBox();
this.panel1.SuspendLayout(); this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.PictureBoxBackground)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.PictureBoxBackground)).BeginInit();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
@ -126,6 +126,7 @@ namespace WindowsFormsApplication1
this.label13.Size = new System.Drawing.Size(180, 13); this.label13.Size = new System.Drawing.Size(180, 13);
this.label13.TabIndex = 23; this.label13.TabIndex = 23;
this.label13.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ"; this.label13.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ";
this.label13.Click += new System.EventHandler(this.label13_Click);
// //
// PictureBoxBackground // PictureBoxBackground
// //
@ -209,6 +210,14 @@ namespace WindowsFormsApplication1
this.panel3.TabIndex = 2; this.panel3.TabIndex = 2;
this.panel3.Visible = false; this.panel3.Visible = false;
// //
// openSpace
//
this.openSpace.Location = new System.Drawing.Point(65, 206);
this.openSpace.Name = "openSpace";
this.openSpace.Size = new System.Drawing.Size(245, 55);
this.openSpace.TabIndex = 17;
this.openSpace.TabStop = false;
//
// SpriteNumberLabel // SpriteNumberLabel
// //
this.SpriteNumberLabel.AutoSize = true; this.SpriteNumberLabel.AutoSize = true;
@ -357,14 +366,6 @@ namespace WindowsFormsApplication1
// //
this.openFileDialog1.FileName = "openFileDialog1"; this.openFileDialog1.FileName = "openFileDialog1";
// //
// openSpace
//
this.openSpace.Location = new System.Drawing.Point(65, 206);
this.openSpace.Name = "openSpace";
this.openSpace.Size = new System.Drawing.Size(245, 55);
this.openSpace.TabIndex = 17;
this.openSpace.TabStop = false;
//
// MainForm // MainForm
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);

View file

@ -134,7 +134,10 @@ namespace WindowsFormsApplication1
persons[nomerPersa].b2.Width = 50; persons[nomerPersa].b2.Width = 50;
persons[nomerPersa].b2.Visible = true; persons[nomerPersa].b2.Visible = true;
persons[nomerPersa].b2.Text = "X"; persons[nomerPersa].b2.Text = "X";
persons[nomerPersa].b2.Click +=
new System.EventHandler(this.label13_Click);
this.panel1.Controls.Add(persons[nomerPersa].b2); this.panel1.Controls.Add(persons[nomerPersa].b2);
persons[nomerPersa].coord = TextBoxWall1.Text; persons[nomerPersa].coord = TextBoxWall1.Text;
persons[nomerPersa].coord2 = TextBoxWall2.Text; persons[nomerPersa].coord2 = TextBoxWall2.Text;
@ -295,5 +298,16 @@ namespace WindowsFormsApplication1
} }
} }
} }
private void label13_Click(object sender, EventArgs e)
{
this.panel1.Controls.Remove(persons[nomerPersa - 1].l1);
this.panel1.Controls.Remove(persons[nomerPersa - 1].l2);
this.panel1.Controls.Remove(persons[nomerPersa - 1].l3);
this.panel1.Controls.Remove(persons[nomerPersa - 1].b1);
this.panel1.Controls.Remove(persons[nomerPersa - 1].b2);
nomerPersa--;
yPersa = yPersa - 30;
}
} }
} }