i have a textbox i want when i enter cursor previous data automatically claer.
i clear it using backspace. how i will solve it.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Aug 16, 2012, 5:23 AM
However, you can still use it if you want by wiring it up yourself as Sukesh did.
I'd put this line in the Form's constructor just after the call to InitializeComponent:
pname.GotFocus += new EventHandler(pname_GotFocus);
and then just paste this method into the Form class somewhere:
Alternatively, if you'd prefer to use the Enter event, locate and double click it in the Properties Box to open up a 'skeleton' handler and add the above line to it. You don't need to do anything else as the designer will wire up the event for you by adding the appropriate code to the InitializeComponent method:
VulpesPosted Aug 16, 2012, 10:42 AM
If that's happening, then it must be due to some other code you have - possibly in the TextChanged or KeyPress eventhandlers, if you have one.
ta muPosted Aug 16, 2012, 6:08 AM
in text box on whose enter event i use this code .
now when i enter mouse eprevious data automatically cleared but this error occur now
ta muPosted Aug 16, 2012, 5:09 AM
Santhosh Kumar JayaramanPosted Aug 16, 2012, 2:32 AM
ta muPosted Aug 16, 2012, 2:18 AM
Sukesh MarlaPosted Aug 15, 2012, 7:37 AM
textBox2.GotFocus += new EventHandler(textBox2_GotFocus);
.
.
Dont forget to check this is correct answer