viewpoint-particle

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

bmclellan

  • Newbie
  • *
  • Posts: 28
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: 2769
    • 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.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

bmclellan

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


Barry