Adalberto Baldini wrote:
> I have a form with : > > ActiveControl = Txt_Username (TEdit) > procedure TLogin_dlg.FormShow(Sender: TObject); > begin > txt_username.SetFocus;
You do not need to do that, just set the ActiveControl property of the form to this edit control at designtime.
Windows does not like it when you change the focus in code at a time when another focus transition is already in progress. The focus situation is a bit fuzzy when you are in the midst of a form creation, especially when you create and show a second form during this process.
-- Peter Below (TeamB) Don't be a vampire (http://slash7.com/pages/vampires), use the newsgroup archives : http://codenewsfast.com http://groups.google.com