Jump to content

Cant'get focus back after ShowMessage


mierlp

Recommended Posts

Hi,

 

After using a ShowMessage for displaying a mesage i can't get back the focus on the field.

When a user hit's a button the following code is executed. Normally it have to set the

focus on the field,but this is not working...or i'm doinng something wrong

 

 

procedure TFormAccountInlog.UniBitBtn_SaveClick(Sender: TObject);
begin
 if Length(UniEdit_InlogUserName.text)=0 then begin
    ShowMessage('<br/><div align="center">Het invulllen van een gebruikersnaam is verplicht!' + '</div><br/>');
    Abort;
    UniEdit_InlogUserName.SetFocus;
 end;
end;

 

Regars Peter

Link to comment
Share on other sites

procedure TFormAccountInlog.UniBitBtn_SaveClick(Sender: TObject);
begin
 if Length(UniEdit_InlogUserName.text)=0 then begin
    ShowMessage('<br/><div align="center">Het invulllen van een gebruikersnaam is verplicht!' + '</div><br/>', procedure (res:integer) begin
      Abort;
      UniEdit_InlogUserName.SetFocus;
    end); 
 end;
end;

 

:)

Link to comment
Share on other sites

procedure TFormAccountInlog.UniBitBtn_SaveClick(Sender: TObject);
begin
  if Length(UniEdit_InlogUserName.text)=0 then begin
     ShowMessage('<br/><div align="center">Het invulllen van een gebruikersnaam is verplicht!' + '</div><br/>', procedure (res:integer) begin
       UniEdit_InlogUserName.SetFocus;

       Abort;  // Attn.
     end);
  end;
end;

Link to comment
Share on other sites

procedure TFormAccountInlog.UniBitBtn_SaveClick(Sender: TObject);

begin

  if Length(UniEdit_InlogUserName.text)=0 then begin

     ShowMessage('<br/><div align="center">Het invulllen van een gebruikersnaam is verplicht!' + '</div><br/>', procedure (res:integer) begin

       UniEdit_InlogUserName.SetFocus;

       Abort;  // Attn.

     end);

  end;

end;

 

Thanks Ronak.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...