Subject Re: [IBO] TIB_Edit : setting borderStyle property
Author Frank Ingermann
Hello Ulrich,

ulrich_groffy wrote:

> Hello, (D7, IBO4.3Aa, W2k/SP4)
>
> I noticed some strange behaviour. I had the idea to visualy enhance
> the active (where the focus is) IB_Edit with a different borderStyle.
> After the cursor enters the IB_Edit, the control seems to be empty
> (?).
>
> My code :
>
> procedure TfrmTest.IB_EditEnter(Sender: TObject);
> begin
> TIB_Edit(Sender).borderStyle:=bsSingle;
> end;
>
> procedure TfrmTest.IB_EditExit(Sender: TObject);
> begin
> TIB_Edit(Sender).borderStyle:=bsNone;
> end;
>
> If I try to change Text.Font.Style or Text.Font.Color with this code
> everything is perfekt.
>
> Any ideas?

no surprise - setting the Borderstyle of <any vcl control>
calls RecreateWND, thus the Windows control that the vcl ctrl
wraps is completely rebuilt. (see TCustomEdit.SetBorderStyle
in StdCtrls.pas).

you could try sthg like:

var
txt : String;
begin
txt := TIB_Edit(Sender).Text;
TIB_Edit(Sender).borderStyle:=bsNone;
TIB_Edit(Sender).Text := txt;
end;

hth,
Frank