I have a form with :
ActiveControl = Txt_Username (TEdit)
procedure TLogin_dlg.FormShow(Sender: TObject);
begin
txt_username.SetFocus;
Label5.Caption := ActiveControl.Name;// only for test
end;
I create the form at run time from Main_frm in OnActivate Event :
Login_dlg := TLogin_dlg.Create( nil );
with Login_dlg do
begin
.......
ShowModal;
if (ModalResult = mrOk) then
begin
.....
end;
When form shows Label5.Caption shows txt_username, but TEdit doesn't have
focus,
cursor doesn't appear in the field, and if type anykey Btn_ok (Default) is
fired.
I need to click the field with the mouse to activate it.
If I reuse form in a second time it works well.
What is missing at starting time ?
Adalberto Baldini