Link to home
Start Free TrialLog in
Avatar of ChLa
ChLaFlag for United States of America

asked on

selected in TEdit

How can i test to see if something is selected (highlighted) in a TEdit ?  I am using a TEdit for numbers only
ASKER CERTIFIED SOLUTION
Avatar of B-o-l-d
B-o-l-d

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ChLa

ASKER

That should work. i will test it tomorrow and let you know. Thank you.

I had found SelectAll. What is SelStart ? Why are none of these things explained in the help files ?
Avatar of Sinisa Vuk
SelectAll is for highlight all text in edit and SelStart is similar to SelLength, it is greater than zero if you select some text in edit and represents start where selecting begins. It is in chars units. Some text is highlighted form SelStart and is long as SelLength.
Avatar of B-o-l-d
B-o-l-d

just to clarify:

SelectAll is a command (procedure/function) to select the whole text in the edit.

SelStart / SelLength are properties to read or write to look, whats selected or to set a selection. hereby points SelStart to the first character in the edit component, that is selected and SelLength tells you how many characters are selected.

copy(MyEdit.Text, MyEdit.SelStart, MyEdit.SelLength) gives you exactly the selected text from a edit box.

cheers,
bold