[BCB6] problem with a TEdit and BorderStyle


2003-07-25 05:27:00 PM
cppbuilder25
Hello,
I would like to modify an Edit BorderStyle propertie by program. For
example, when I enter the Edit component, I want the BorderStyle change from
bsNone to bsSingle.
I've tried :
void __fastcall TForm1::Edit1Enter(TObject *Sender)
{
Edit1->BorderStyle = bsSingle;
}
//--------------------------------------------------------------------------
-
void __fastcall TForm1::Edit1Exit(TObject *Sender)
{
Edit1->Color = bsNone;
}
but then, when I enter the Edit component, the cursor dissapear and I can
not select the text in the Edit box !! I've try the same code with Color
instead of BorderStyle properties and it works perfectly.
Can anyone explain me why this does not work and how can I solve this
problem ? Somebody told me that modifying BorderStyle properties by program
was nos a good thing, but I do not understand why ?
Thanks in advance for your help.
Christophe.