WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: bmclellan on December 12, 2018, 11:41:00 AM

Title: Disable controls in a dialog box via for loop
Post by: bmclellan on December 12, 2018, 11:41:00 AM
Hello,

Is it possible to disable dialog controls through a for loop of some kind?

I'm hoping there is some way I can query a control name based on the dialog control number to disable it:

i.e.    for xloop = 1 to DialogNumControls
             controlName = getControlName(Handle,xloop)
             DialogControlState(Handle,controlName,@dcsAddStyle,@csDisabled)
        next xloop


Sorry if it is in the Tech site somewhere, I searched on Dialog and disable and had so many hits I got lost!


Thanks
Barry
Title: Re: Disable controls in a dialog box via for loop
Post by: td on December 12, 2018, 01:13:24 PM
Check out the DialogProcOptions function in the Consolidated WIL Help file.  You can use the @dpoCtlName "event_code" to convert from number to name.
Title: Re: Disable controls in a dialog box via for loop
Post by: bmclellan on December 12, 2018, 07:05:10 PM
Thanks Tony!!


Barry