Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread ActiveControl in TForm
Wed, May 1 2013 2:37 AMPermanent Link

Christian Kaufmann

Since there is no ActiveControl property I tried to use SetFocus in OnShow:

procedure TFBSLoginDlg.FBSLoginDlgShow(Sender: TObject);
begin
 if EUsername.Text <> ''
   then EPassword.SetFocus;
end;

But when I look at WebForms TForm.Show, then FirstControl() is called again after the OnShow event.

So how can I set the initial active control when a form is showing?

cu Christian
Wed, May 1 2013 6:00 AMPermanent Link

Peter

On 01.05.2013 08:37, Christian Kaufmann wrote:
> So how can I set the initial active control when a form is showing?

Workaround: Place a Timer (Interval 100) on your Form and OnTimer-Event
call:

procedure TFBSLoginDlg.Timer1Timer(Sender: TObject);
begin
   Timer1.Enabled := False;
   EPassword.SetFocus;
end;

Greetings ... Peter
Fri, May 3 2013 9:50 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Christian,

<< Since there is no ActiveControl property I tried to use SetFocus in
OnShow:

procedure TFBSLoginDlg.FBSLoginDlgShow(Sender: TObject);
begin
 if EUsername.Text <> ''
   then EPassword.SetFocus;
end;

But when I look at WebForms TForm.Show, then FirstControl() is called again
after the OnShow event. >>

I'll have to modify this behavior in the next build/release.

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image