PDA

View Full Version : Disable( ) button



devinrader
10-20-2003, 09:34 AM
I need to disable the next button on my custom form to make the user fill in some information before continuing.

I am trying to use the Disable() function in the dialogs INIT event, but it does not disable the button. I have tried:

Disable( NEXTBUTTON );

and

Disable ( RES_PBUT_NEXT );

neither works no matter where in the script I put it. If I disable the button during the dialogs designtime, then I cannot Enable the button at runtime.

Also, the Disable( ) function does return 0 indicating success.

Any ideas?

Devin

alex42
10-20-2003, 10:04 AM
it should work doing it like this:

hDlg = CmdGetHwndDlg(sDlg);
hButton = GetDlgItem(hDlg, <CtrlID>);
EnableWindow(hButton, FALSE);
EnableWindow(hButton, TRUE);

RobertDickau
10-20-2003, 10:38 AM
For a specific example, perhaps see the source code for the SdRegisterUser dialog box, which disables the Next button unless both text fields contain text.

The source is in:

...\DevStudio 9\Script\isrt\src\SdRegisterUserDlg.rul