We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 01e1120 commit bf7d441Copy full SHA for bf7d441
Form1.cs
@@ -169,8 +169,12 @@ private void TextBoxFilter(object sender, EventArgs e)
169
TextBox current = sender as TextBox;
170
string mask = current.Tag.ToString() == "MotionName" ? @"^\w*$" : @"^[0-9,]*$";
171
Match match = Regex.Match(current.Text, mask);
172
- if (!match.Success) current.Text = current.Text.Remove(current.Text.Length - 1, 1);
173
- current.SelectionStart = current.Text.Length;
+ if (!match.Success)
+ {
174
+ int temp = current.SelectionStart;
175
+ current.Text = current.Text.Remove(current.SelectionStart-1, 1);
176
+ current.SelectionStart = temp-1;
177
+ }
178
179
AnimationParams CurrentAnim = listBox1.SelectedItem as AnimationParams;
180
0 commit comments