Page 1 of 1
Dialog Object Rules: Enable Next if three controls OK
Posted: Mon Jan 18, 2010 10:24 am
by khalprin
I've created a dialog for installing a service. The user can select to install using the local system account or a specific user account. How can I enable the 'Next' button only if:
The local system radio button is selected
-or-
the specific user radio button is selected and the user account field has text and the password field has text.
Thanks.
Posted: Wed Jan 20, 2010 6:46 am
by rafaello
Here you are:
IF (rbtnSpecificUser.Checked = True) THEN Next.Enabled := False;
IF (tbxAccount.Text <> ) THEN Next.Enabled := True;
IF (tbxAccount.Text = ) THEN Next.Enabled := False;
IF (tbxPassword.Text = ) THEN Next.Enabled := False;
IF (rbtnLocalSystem.Checked = True) THEN Next.Enabled := True;
As default local system radio button (rbtnLocalSystem) must be selected.
Posted: Wed Jan 20, 2010 11:01 am
by khalprin
Thanks rafaello,
I ended up doing the check in the script after the dialog returns. I added a second password field to confirm that the two password fields match, and that made it more complicated. There's a lot of flicker, but I'll live with it.
Posted: Wed Jan 20, 2010 12:05 pm
by ALive
Hi, khalprin!
To avoid flickering use some hidden label somewhere on the dialog, make the CheckControls set it's Text property to FALSE in case when you need to Disable Next button. And TRUE for the opposite meaning.
And make data exchange between that label and Next button
This should help!