Dialog Object Rules: Enable Next if three controls OK

Got a problem you cannot solve? Try here.
Post Reply
khalprin
Posts: 51
Joined: Fri Aug 25, 2006 2:02 pm

Dialog Object Rules: Enable Next if three controls OK

Post 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.
rafaello
Posts: 3
Joined: Wed Jan 20, 2010 5:49 am

Post 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.
khalprin
Posts: 51
Joined: Fri Aug 25, 2006 2:02 pm

Post 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.
ALive
Posts: 109
Joined: Mon Apr 27, 2009 5:54 am
Location: Russia

Post 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!
Post Reply