Merge branch 'master' into Zifrkoks-patch-2

This commit is contained in:
Mikhail Abramov 2018-04-11 12:28:55 +04:00 committed by GitHub
commit 6457307fdc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View file

@ -309,6 +309,7 @@ namespace WindowsFormsApplication1
this.TextBoxWall2.Name = "TextBoxWall2"; this.TextBoxWall2.Name = "TextBoxWall2";
this.TextBoxWall2.Size = new System.Drawing.Size(100, 20); this.TextBoxWall2.Size = new System.Drawing.Size(100, 20);
this.TextBoxWall2.TabIndex = 3; this.TextBoxWall2.TabIndex = 3;
this.TextBoxWall2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxWall1_KeyPress);
// //
// TextBoxWall1 // TextBoxWall1
// //
@ -316,6 +317,7 @@ namespace WindowsFormsApplication1
this.TextBoxWall1.Name = "TextBoxWall1"; this.TextBoxWall1.Name = "TextBoxWall1";
this.TextBoxWall1.Size = new System.Drawing.Size(100, 20); this.TextBoxWall1.Size = new System.Drawing.Size(100, 20);
this.TextBoxWall1.TabIndex = 2; this.TextBoxWall1.TabIndex = 2;
this.TextBoxWall1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.TextBoxWall1_KeyPress);
// //
// ComboBoxMove // ComboBoxMove
// //

View file

@ -94,6 +94,9 @@ namespace WindowsFormsApplication1
private void SaveCharButtonClick(object sender, EventArgs e) private void SaveCharButtonClick(object sender, EventArgs e)
{ {
String[] arr = TextBoxWall1.Text.Split(new String[] { " " }, StringSplitOptions.None);
MessageBox.Show(arr[0]);
persons[nomerPersa].l1 = new Label(); persons[nomerPersa].l1 = new Label();
persons[nomerPersa].l1.Top = yPersa; persons[nomerPersa].l1.Top = yPersa;
persons[nomerPersa].l1.Left = 30; persons[nomerPersa].l1.Left = 30;
@ -309,5 +312,15 @@ namespace WindowsFormsApplication1
nomerPersa--; nomerPersa--;
yPersa = yPersa - 30; yPersa = yPersa - 30;
} }
private void TextBoxWall1_KeyPress(object sender, KeyPressEventArgs e)
{
char c = e.KeyChar;
if (!(char.IsDigit(c) || c == '\b' || c == ' '))
{
e.Handled = true;
}
}
} }
} }