 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Alan Guest
|
Posted: Wed Oct 29, 2003 3:52 am Post subject: TEdit.SetFocus |
|
|
I have a TEdit box on a form, and also a groupbox, at some time the focus is
on the group box and I want to set the focus at the edit box.
I tried SetFocus method of the edit box but the text was also highlighted, I
just want to put the cursor at the end of the text.
|
|
| Back to top |
|
 |
Arno Verhoeven Guest
|
Posted: Wed Oct 29, 2003 6:59 am Post subject: Re: TEdit.SetFocus |
|
|
Alan wrote:
| Quote: | I have a TEdit box on a form, and also a groupbox, at some time the
focus is on the group box and I want to set the focus at the edit box.
I tried SetFocus method of the edit box but the text was also
highlighted, I just want to put the cursor at the end of the text.
|
MyEdit.SetFocus;
MyEdit.SelStart := length(MyEdit.Text);
HTH
Arno
|
|
| Back to top |
|
 |
Kurt Barthelmess Guest
|
Posted: Wed Oct 29, 2003 11:06 am Post subject: Re: TEdit.SetFocus |
|
|
"Alan" <NOSPAMalanpltse (AT) yahoo (DOT) com.au> wrote:
| Quote: | I have a TEdit box on a form, and also a groupbox, at some time the focus is
on the group box and I want to set the focus at the edit box.
I tried SetFocus method of the edit box but the text was also highlighted, I
just want to put the cursor at the end of the text.
|
If you want it at the end, do as Amo suggested. If you want the caret
left as it was the last time the edit had the focus, set
Edit1.AutoSelect to False.
Good luck.
Kurt
|
|
| Back to top |
|
 |
Alan Guest
|
Posted: Fri Oct 31, 2003 3:38 am Post subject: Re: TEdit.SetFocus |
|
|
Yes, set AutoSelect := FALSE
Thanks
"Kurt Barthelmess (TeamB)" <kbarthelmess (AT) compuserve (DOT) com> wrote
| Quote: | "Alan" <NOSPAMalanpltse (AT) yahoo (DOT) com.au> wrote:
I have a TEdit box on a form, and also a groupbox, at some time the focus
is
on the group box and I want to set the focus at the edit box.
I tried SetFocus method of the edit box but the text was also
highlighted, I
just want to put the cursor at the end of the text.
If you want it at the end, do as Amo suggested. If you want the caret
left as it was the last time the edit had the focus, set
Edit1.AutoSelect to False.
Good luck.
Kurt
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|