<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/>
<title></title>
</head>
<body>
<p style="margin: 0px;"><span> </span></p>
<p style="margin: 0px;"> </p>
<div style="margin: 5px 0px 5px 0px;">
u-boot <myabos@t-online.de> hat am 24. Januar 2011 um 17:49 geschrieben:<br/>
<br/>
> Same question here as in irc nobody answered it a few hours ago.<br/>
><br/>
><br/>
> I tried the following lines. It does not work with setfocus before<br/>
> parent changing.<br/>
> My question is, if it should work in this order or if this is correct<br/>
> behaviour.<br/>
><br/>
><br/>
> procedure TForm1.Button1Click(Sender: TObject);<br/>
> begin<br/>
> edit1.SetFocus;<br/>
> if (Edit1.Parent=Panel2) Then Edit1.Parent:=Panel1 else<br/>
> Edit1.Parent:=Panel2;<br/>
> end;
</div>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Changing the Parent switches the focus to another control.</p>
<p style="margin: 0px;">So, you should set the focus after changing the parent.</p>
<p style="margin: 0px;"> </p>
<p style="margin: 0px;">Mattias</p>
<br/>
</body>
</html>