| | |
Can't clear textbox
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: May 2009
Posts: 39
Reputation:
Solved Threads: 0
Hi Folks,
I have a textbox which looks out for keypresses when it is in focus.
For example, when the ";" key is pressed, a few functions are called. THe problem is, is that in the KeyPress function for the textbox, i have textbox1.Text = ""; to clear it however it doesn't work.
It's as if the text box executes the KeyPress function (hence my clear statement) prior to actually outputting the ";" in the box.
So in the end, ";" gets displayed (However if I keep pressing ";", I only ever see one)
Any ideas on how I can fix this? Thanks
I have a textbox which looks out for keypresses when it is in focus.
For example, when the ";" key is pressed, a few functions are called. THe problem is, is that in the KeyPress function for the textbox, i have textbox1.Text = ""; to clear it however it doesn't work.
It's as if the text box executes the KeyPress function (hence my clear statement) prior to actually outputting the ";" in the box.
So in the end, ";" gets displayed (However if I keep pressing ";", I only ever see one)
Any ideas on how I can fix this? Thanks
Last edited by jonnytabpni; May 3rd, 2009 at 7:07 pm.
![]() |
Similar Threads
- [Textfield clear not working] (VB.NET)
- Clear Text in Textbox.... (Visual Basic 4 / 5 / 6)
- VB.NET Project Help, will pay (Software Development Job Offers)
- Simple Array Calculator Help (Visual Basic 4 / 5 / 6)
- in visual basic 6... (Visual Basic 4 / 5 / 6)
- Delete from a listbox (Visual Basic 4 / 5 / 6)
- Deleting TextBox'es cause application losing foucs (C#)
Other Threads in the C# Forum
- Previous Thread: Binding SelectedValue from Dataset
- Next Thread: Detecting access data change in C#
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# chat check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format formatting forms function gdi+ httpwebrequest image index input install java label list listbox listener mandelbrot marshalbyrefobject math mouseclick mysql networking object operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml





