Dear All,
I have a question about textbox in c sharp. I want to add a "-" after I type 2 characters inside a text box, the thing is if I use textBox1.Text += "-", the type pointer returns to the beginning. Any idea on this simple question?
Thanks in advance,
E

1 answers
Try this:
answered one year ago by:
2499
301
thanks foamy, it works but only for 2 first characters. Is it possible to include an - everytime the user types 2 characters?
17279
Try changing: if (textBox1.Text.Length == 2) to: if ((textBox1.Text.Length % 3) == 2)
2499
good one vulpes :)