Mischamel Posted January 28, 2004 Posted January 28, 2004 Hi, I´d like to set the Cursor into TextBox, behind its start text. Tried several methods, but I didn´t get it working. .focus(), .select(), pointtoscreen() etc. Any other ideas, how to get this blinking one, into the TBox Quote Sometimes you´ve got to make a silent Takedown .
*Experts* mutant Posted January 28, 2004 *Experts* Posted January 28, 2004 You want to move the caret ("the blinking one") to the end of the text right? This should help you: (I can't test it now) TextBox1.SelectionStart = TextBox1.Text.Length Quote
Mischamel Posted January 28, 2004 Author Posted January 28, 2004 Nope! I even tried it before in a similar way. But your suggest doesn´t work proper as well. No caret blinkin in my TBox. Quote Sometimes you´ve got to make a silent Takedown .
*Experts* mutant Posted January 28, 2004 *Experts* Posted January 28, 2004 Did you set focus to the textbox? Quote
NK2000 Posted January 28, 2004 Posted January 28, 2004 i also looked at some other posts about this topic but i found the answer that everything works well with richtextbox but textbox wont work, but there must be a solution maybe you have to do an win32 call Quote
*Experts* mutant Posted January 28, 2004 *Experts* Posted January 28, 2004 (edited) NK2000, i just tested the code I showed and it works well. It will set the caret at the specified position. The textbox must of course have focus to show the caret at all. Edited January 28, 2004 by mutant Quote
NK2000 Posted January 28, 2004 Posted January 28, 2004 oh *bow* i am sorry, so i wonder why it doesnt work at his project.. Quote
Mischamel Posted January 29, 2004 Author Posted January 29, 2004 I ain´t gonna get it working, either with TBox nor RichTextBox and methods shown above. I guess its as usual. It won´t fit for me. Thanks MS. But I'll keep on trying and if something positive should happen, I´ll be reporting. Quote Sometimes you´ve got to make a silent Takedown .
Mischamel Posted January 29, 2004 Author Posted January 29, 2004 Ok. It works just the way mutant wrote. But not in a ChildForm. It´s working fine within a Panel, which I took to replace the form. Thanks so far guys, you helped me a lot. Quote Sometimes you´ve got to make a silent Takedown .
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.