This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How to control input on customized dialog?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
‎Nov 04, 2010
10:13 PM
How to control input on customized dialog?
Edition: Installshield 2010
Project Type: installscript project
summary: I have designed a project which requires user to input serial number during installation, and I customized the dialog for input serial number. Everything has gone well, but there's one thing I feel not satisfied: I design 4 textfields(edit fields) for serial number, a serial number is of 16 digits, so every textfield, in a perfect status, should only be input 4 digits.
The problem is, how can I control the input for every textfield, for example, if user input 123456 in one textfield, 56 should be ingored; and how can put focus on the next textfield if one textfield has input 4 digits?
Project Type: installscript project
summary: I have designed a project which requires user to input serial number during installation, and I customized the dialog for input serial number. Everything has gone well, but there's one thing I feel not satisfied: I design 4 textfields(edit fields) for serial number, a serial number is of 16 digits, so every textfield, in a perfect status, should only be input 4 digits.
The problem is, how can I control the input for every textfield, for example, if user input 123456 in one textfield, 56 should be ingored; and how can put focus on the next textfield if one textfield has input 4 digits?
(3) Replies
‎Nov 05, 2010
06:49 AM
Hi.
In InstallScript/InstallScript MSI dialogs you can catch LBN_SELCHANGE notification for edit boxes and after that change the control text back or move focus to another control.
In InstallScript/InstallScript MSI dialogs you can catch LBN_SELCHANGE notification for edit boxes and after that change the control text back or move focus to another control.
nId = WainOnDialog(szDlg);
switch(nId)
...
case EDITBOXID:
if(CtrlGetSubCommand (szDlg) = EDITBOX_CHANGE) then
CtrlGetText(szDlg,EDITBOXID,szText);
if(StrLengthChars(szText) > 4) then
CtrlSetText(...);
hwndCtrl = GetDlgItem(hwndDlg,EDITBOXID_2);
SetFocus(hwndCtrl);
endif;
endif;
...
endswitch;
‎Nov 05, 2010
12:16 PM
why allow them to enter more characters than you want to allow? Maybe I'm missing something, the textbox has a property Max. Length..
As for focus, why move the focus. Why not just create a tab order that makes sense. Most UI designs struggle with moving a user automatically from one field to another (i.e. my favorite is phone number when a developer breaks it into 3 textboxes).
As for focus, why move the focus. Why not just create a tab order that makes sense. Most UI designs struggle with moving a user automatically from one field to another (i.e. my favorite is phone number when a developer breaks it into 3 textboxes).