Click here to Skip to main content
16,022,417 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to select word under cursor when clicking only once in multiline textbox (Resulting like double clicking ) in C#
Posted

Hi.
So far I know there are no builtin function gives you this type of functionality, When you double click it will auto select the word by nature. However What I would do for this something like:

(1) When you click on the word, At first I find the position.
(2) Try to find is the previous / next char is space or not.
(3) If both condition is satisfied then highlight it / else
if there is no space at the previous but found after counting few char then highlight it.
 
Share this answer
 
I would like to bring your attention the fact that this selection effect would greatly confuse the edition of the document, especially for the users heavily relying on the mouse; even for read-only document this behavior could irritate the user as different from what is usually expected.

Just the note. Be careful.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900