mierlp Posted January 23, 2013 Share Posted January 23, 2013 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 Quote Link to comment Share on other sites More sharing options...
heromo80 Posted January 23, 2013 Share Posted January 23, 2013 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; Quote Link to comment Share on other sites More sharing options...
mierlp Posted January 23, 2013 Author Share Posted January 23, 2013 Hi Thanks for the reply...it works...and i'm happy Regards Peter Quote Link to comment Share on other sites More sharing options...
belo Posted January 26, 2013 Share Posted January 26, 2013 Hi Thanks for the reply...it works...and i'm happy Regards Peter procedure (res:integer) ??? Does not work! You can post your solution? Thanks! Quote Link to comment Share on other sites More sharing options...
Ronak Posted January 28, 2013 Share Posted January 28, 2013 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; Quote Link to comment Share on other sites More sharing options...
belo Posted January 29, 2013 Share Posted January 29, 2013 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.