Jump to content

Recommended Posts

Posted

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

Posted

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;

 

:)

Posted

Hi

 

Thanks for the reply...it works...and i'm happy biggrin.gif

 

 

Regards Peter

 

procedure (res:integer) ???

 

 

Does not work!
 
You can post your solution?
 
Thanks!
Posted

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;

Posted

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.

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...