- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Not able to change text control text using the "CtrlSetText" command.
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
I have a custom dialog box with text controls on it. How can I change the text using install script?
I have a text control and I tried to change the text using the "CtrlSetText" command. I also tried changing the edit control text using "CtrlSetText" but that also is not working? Attached is my projects .ism and my .rul files.
Please help !
p.s., I am using both InstallShield 2019, and 2016, for project creation. Also below is the .rul file I am using for my custom dialog where CtlrSetText is being called:
#define BUTTON_NEXT 1
#define BUTTON_BACK 12
#define DialogBoxIdentifier 50
#define UserNameText 1302
#define InputTextBox 1303
prototype NUMBER FirstDialog();
function NUMBER FirstDialog()
BOOL bDone;
BOOL isSelected;
NUMBER nControl, nReturn;
HWND hInstance, hwndParent, hwndDlg;
string szDlg;
STRING szDialogName;
begin
szDialogName = "FirstDialog";
CtrlSetText(szDialogName,UserNameText,"Hello");
CtrlSetText(szDialogName,InputTextBox,"World");
EzDefineDialog(
"FirstDialog",
"",
"",
DialogBoxIdentifier);
bDone = FALSE;
while (!bDone)
nControl = WaitOnDialog("FirstDialog");
switch (nControl)
case DLG_INIT:
hwndDlg = CmdGetHwndDlg("FirstDialog");
SdGeneralInit("FirstDialog", hwndDlg, 0, "");
case BUTTON_BACK:
// user clicked Back
nReturn = BUTTON_BACK;
bDone = TRUE;
case BUTTON_NEXT:
nReturn = BUTTON_NEXT;
bDone = TRUE;
default:
if (SdIsStdButton(nControl) && SdDoStdButton(nControl)) then
bDone = TRUE;
endif;
endswitch;
endwhile;
EndDialog("FirstDialog");
ReleaseDialog("FirstDialog");
return nReturn;
end;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Move CtrlSetText command after dialog gets initialized.
while (!bDone)
nControl = WaitOnDialog("FirstDialog");
switch (nControl)
case DLG_INIT:
hwndDlg = CmdGetHwndDlg("FirstDialog");
SdGeneralInit("FirstDialog", hwndDlg, 0, "");
CtrlSetText(szDialogName,UserNameText,"Hello");
CtrlSetText(szDialogName,InputTextBox,"World");
case BUTTON_BACK:
// user clicked Back
nReturn = BUTTON_BACK;
bDone = TRUE;
case BUTTON_NEXT:
nReturn = BUTTON_NEXT;
bDone = TRUE;
default:
if (SdIsStdButton(nControl) && SdDoStdButton(nControl)) then
bDone = TRUE;
endif;
endswitch;
endwhile;
For more information, please refer below link.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Move CtrlSetText command after dialog gets initialized.
while (!bDone)
nControl = WaitOnDialog("FirstDialog");
switch (nControl)
case DLG_INIT:
hwndDlg = CmdGetHwndDlg("FirstDialog");
SdGeneralInit("FirstDialog", hwndDlg, 0, "");
CtrlSetText(szDialogName,UserNameText,"Hello");
CtrlSetText(szDialogName,InputTextBox,"World");
case BUTTON_BACK:
// user clicked Back
nReturn = BUTTON_BACK;
bDone = TRUE;
case BUTTON_NEXT:
nReturn = BUTTON_NEXT;
bDone = TRUE;
default:
if (SdIsStdButton(nControl) && SdDoStdButton(nControl)) then
bDone = TRUE;
endif;
endswitch;
endwhile;
For more information, please refer below link.
