viewpoint-particle

Author Topic: Disable controls in a dialog box via for loop  (Read 56 times)

bmclellan

  • Newbie
  • *
  • Posts: 24
Disable controls in a dialog box via for loop
« 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

td

  • Tech Support
  • *****
  • Posts: 2689
    • WinBatch
Re: Disable controls in a dialog box via for loop
« Reply #1 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.
"Success is a lousy teacher. It seduces smart people into thinking they can't lose."
  - Bill Gates


bmclellan

  • Newbie
  • *
  • Posts: 24
Re: Disable controls in a dialog box via for loop
« Reply #2 on: December 12, 2018, 07:05:10 pm »
Thanks Tony!!


Barry