Sign in to follow this  
Followers 0
Petyas

Caret position in TextBox in C#

2 posts in this topic

How is it possible to get a caret position (row,collumn or current char position in string) in textbox control. TextBox have a method Select(position, length), but how can i obtain current position? If isn't way in C#, exists some method what i can import from any DLL? I found only method GetCaretPosition from coredll.dll. This method returns x, y position of caret, but this method i cannot use, because every char has a different width. This i need for select, cut, copy and paste.

Any idea?

Thanks

0

Share this post


Link to post
Share on other sites

It is "TextBox.SelectionStart". You can either get it and set it.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2016. MoDaCo uses IntelliTxt technology.