c# how to place caret/cursor position at start or end of textbox

This question has been addressed by many but I will give you an insight on this too

Say you textbox is named: txtCaret

Now to move the Caret position to the end of text in txtCaret simple use the code below

[geshi lang=”csharp” nums=”1″ target=”_self” ]

And If you like the Caret position at the beginning of the text Box use the following code

If you would like to select all text with txtCaret use the code below

[geshi lang=”csharp” nums=”1″ target=”_self” ]

So you can do pretty much select any given string in a textbox if you really know what your selection will be.

I hope this helps

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.