Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you make active or highlight text? 1

Status
Not open for further replies.

sassygirl

Technical User
Mar 20, 2002
16
0
0
US
Hi all,
To be simple, here is the setup. There are only two components: a BitBtn and a TEdit. This is what I want: After clicking on the BitBtn, it will automatically go to the TEdit box and make active or highlight whatever value is in the TEdit box. Simple enough? =) Thanks for you help.

-sassygirl
 
In the BitBtn's click method you do EditBox->Enabled = true.
Code:
void __fastcall TForm::BitBtnClick(TObject *Sender)
{
    EditBox->Enabled = true;
}

To highlight an item in the box is a little more complex. James P. Cottingham

I am the Unknown lead by the Unknowing.
I have done so much with so little
for so long that I am now qualified
to do anything with nothing.
 
Hi,
Thanks for the tip. I was hoping making active an TEdit box would highlight the value in it. Well, how copmlex IS it to highlight an item?

-sassygirl
 
it's not complex. Do something like this:

set AutoSelect to be true,
then under the BitBtn Click, do this:

void __fastcall TForm::BitBtnClick(TObject *Sender)
{
EditBox->SetFocus();
/* or Focused == true;*/
}

That will select, or make active, the Edit box. Setting AutoSelect to true will make the contents of the edit box highlight automatically when focus is set to it. Cyprus
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top