u-boot <[email protected]> hat am 24. Januar 2011 um 17:49 geschrieben:

> Same question here as in irc nobody answered it a few hours ago.
>
>
> I tried the following lines. It does not work with setfocus before
> parent changing.
> My question is, if it should work in this order or if this is correct
> behaviour.
>
>
> procedure TForm1.Button1Click(Sender: TObject);
> begin
>   edit1.SetFocus;
>   if (Edit1.Parent=Panel2) Then Edit1.Parent:=Panel1 else
> Edit1.Parent:=Panel2;
> end; 
Changing the Parent switches the focus to another control.
So, you should set the focus after changing the parent.
 
Mattias
--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to