Join us for SoftSummit 2023. The 20th anniversary of the industry leading software monetization conference. April 18 and 20. Register Now

Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 2

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?
Labels (1)
0 Kudos
3 Replies
Level 5


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);
if(CtrlGetSubCommand (szDlg) = EDITBOX_CHANGE) then
if(StrLengthChars(szText) > 4) then
hwndCtrl = GetDlgItem(hwndDlg,EDITBOXID_2);
0 Kudos
Level 6

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).
0 Kudos
Level 5

If you can use Max Length and Tab Order you can go with it.
I just don't like MSI and try first to do everything with InstallScript.
0 Kudos