Removeing Certain Characters From a Textbox
I'm trying to limit what the user can enter into a textbox. The easy part is knowing if they tried to type that character, the hard part is removing that single character. Does anyone know how? e.SuppressKeyPress is really buggy and not working right.
I've tried Textbox1.text.replace("|", "") and Textbox1.text.remove(Textbox1.textlength - 1), no luck there.
Silly question (..but without seeing the code), did you just call
Textbox1.text.replace("|", "")
or
TextBox1.Text = Textbox1.text.replace("|", "")
? Because strings are immutable, the first one won't work as you might expect.
"Also, I'm using GetAsyncKeyState to see if the user presses the button."
I assumed you were using one of the textbox_keypress_events..kind of an important detail : p