Merge pull request #37 from IngenerkaTeamCenter/Zifrkoks-patch-2

можно удалять персонажей из списка
This commit is contained in:
Mikhail Abramov 2018-04-11 12:29:03 +04:00 committed by GitHub
commit 190b120268
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -126,6 +126,7 @@ namespace WindowsFormsApplication1
this.label13.Size = new System.Drawing.Size(180, 13);
this.label13.TabIndex = 23;
this.label13.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ";
this.label13.Click += new System.EventHandler(this.label13_Click);
//
// PictureBoxBackground
//

View file

@ -137,8 +137,11 @@ namespace WindowsFormsApplication1
persons[nomerPersa].b2.Width = 50;
persons[nomerPersa].b2.Visible = true;
persons[nomerPersa].b2.Text = "X";
persons[nomerPersa].b2.Click +=
new System.EventHandler(this.label13_Click);
this.panel1.Controls.Add(persons[nomerPersa].b2);
persons[nomerPersa].coord = TextBoxWall1.Text;
persons[nomerPersa].coord2 = TextBoxWall2.Text;
persons[nomerPersa].nomer = nomerPersa;
@ -299,6 +302,17 @@ 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;
}
private void TextBoxWall1_KeyPress(object sender, KeyPressEventArgs e)
{
char c = e.KeyChar;