回答編集履歴
3
break漏れ
answer
CHANGED
@@ -16,6 +16,7 @@
|
|
16
16
|
foreach(Control control in textbox.FindForm().Controls) {
|
17
17
|
if (control.Name.Equals(newTextBoxName)) {
|
18
18
|
control.Focus();
|
19
|
+
break;
|
19
20
|
}
|
20
21
|
}
|
21
22
|
}
|
2
誤字修正
answer
CHANGED
@@ -9,12 +9,12 @@
|
|
9
9
|
TextBox textbox = sender as TextBox;
|
10
10
|
if (textBox.Text.Length == textBox.MaxLength) {
|
11
11
|
Int32 num = 0;
|
12
|
-
Int32.TryParse(textBox.Name.Substring("textBox".
|
12
|
+
Int32.TryParse(textBox.Name.Substring("textBox".Length), out num);
|
13
13
|
if (num != 0) {
|
14
14
|
num++;
|
15
15
|
String newTextBoxName = String.Format("textBox{0}", num);
|
16
16
|
foreach(Control control in textbox.FindForm().Controls) {
|
17
|
-
if (control.Name.
|
17
|
+
if (control.Name.Equals(newTextBoxName)) {
|
18
18
|
control.Focus();
|
19
19
|
}
|
20
20
|
}
|
1
誤字修正
answer
CHANGED
@@ -9,12 +9,12 @@
|
|
9
9
|
TextBox textbox = sender as TextBox;
|
10
10
|
if (textBox.Text.Length == textBox.MaxLength) {
|
11
11
|
Int32 num = 0;
|
12
|
-
Int32.TryParse(textBox.
|
12
|
+
Int32.TryParse(textBox.Name.Substring("textBox".length), out num);
|
13
13
|
if (num != 0) {
|
14
14
|
num++;
|
15
15
|
String newTextBoxName = String.Format("textBox{0}", num);
|
16
16
|
foreach(Control control in textbox.FindForm().Controls) {
|
17
|
-
if (control.
|
17
|
+
if (control.Name.equals(newTextBoxName)) {
|
18
18
|
control.Focus();
|
19
19
|
}
|
20
20
|
}
|