Click here to Skip to main content
15,884,176 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to get read a deselect text from a full text in a combobox where some text are selected.

Suppose the searching text is emergency where emer is not highlighted but gency is highlighted.
So I need to read this deselect text emer to perform operation.

Help me plz.Thanks in advance.
Posted

1 solution

Also a ComboBox has a SelectionStart and a SelectionLength property. Hence you can work with Text.Substring and get the parts of the text you need.
 
Share this answer
 
Comments
Member 8454009 24-Apr-13 10:15am    
textbox2.Text = textbox1.Text.Substring(textbox1.SelectionStart, textbox1.SelectionLength);

I am in trying. But this code is not working. Please any solution in this problem.
Bernhard Hiller 25-Apr-13 2:23am    
C'mon - your code does exactly the opposite: it gets the selected text. Actually I'd expected also a beginner to test e.g.
textbox1.Text.Substring(0, textbox1.SelectionStart) and textbox1.Text.Substring(textbox1.SelectionStart + textbox1.SelectionLength);
or combinations thereof...

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