I am using a TIWAdvMessageDialog to obtain a string from the user. I have set InputType to string.
iwDlgForgotPassword.Notes := 'Please enter the email address you registered with:';
iwDlgForgotPassword.Caption := 'Forgotten password';
iwDlgForgotPassword.EmptyText := 'Your email address';
iwDlgForgotPassword.ShowAsync;
The dialog itself works fine but the problem is that when it is shown it does not have focus. The user needs to click in the text box before they can type. How can I set the focus to the text box automatically?
Thanks for that Bart.
If I take the edit box off the dialog and just show a simple dialog with notes, caption and OK button, focus is still not set to the dialog when it is shown. I would like the user to be able to dismiss the dialog box simply by pressing enter rather than having to click the OK button.
Is that possible?
I have not been able to reproduce this issue.
By default the Ok button should receive focus when the IWAdvMessageDialog is displayed.
I have done some testing.
- Just a form with a button, button displays the dialog using ShowAsync - works as expected.
- A form with a region; dialog and button belong to the region - works as expected.
- A form with a region; button belongs to the region, dialog belongs to the form - dialog does not receive focus when shown.
So I realise now I can solve this problem by placing the IWAdvMsgDlg on the region I am calling it from. However it would be nice to have just one IWAdvMsgDlg that I can use from multiple regions on the form. Is this possible?
Thanks.
Sorry, forgot to say I am using XE2, IW 12.1.26 and the current version of the TMS components.
Can you please provide a ready to run sample project that demonstrates the issue so I can further investigate this?
Hi Bart,
I have tried this with a new application and the scenario I have described above does work as expected. Therefore it must be something else I have on the form. If I can narrow it down to something in particular I'll post again. In the meantime thanks for your help.