mierlp Posted January 23, 2013 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
heromo80 Posted January 23, 2013 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
mierlp Posted January 23, 2013 Author Posted January 23, 2013 Hi Thanks for the reply...it works...and i'm happy Regards Peter Quote
belo Posted January 26, 2013 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
Ronak Posted January 28, 2013 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
belo Posted January 29, 2013 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
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.