I have been having fun and games with this (trying to grey out a %rd with spin control) and have still not come up with a completely satisfactory solution. Please see the code snippet below by way of illustration, from which three variant applets can be built by commenting out three alternative pairs of lines: those labelled either !1?, !2? or !?b (where ? denotes single character wildcard).
With !1? active, I am trying to use the ~ modifier, as documented. This greys out the edit box (although not until an attempt is made to edit), but does not disable the spin control - so I can edit a greyed out value 'by proxy'.
With !2? active, I am trying to use the %lc control in conjunction with the WinAPI function EnableWindow to grey out the %rd edit box. Even though the previous control is the %rd, this remains enabled, and the spin control is disabled - the reverse of what the ~ modifer achieves!
The only way I can achieve what I want to achieve, after a lot of trial and error, is with !?b active, which greys out the edit box *and *disables the spin control. But I don't understand why it works, and don't think it should.
Andy
program grey_doubt
use grey_day
integer iodial, tintin
gcswit = 1
tintin = 5
iodial = winio@ ('%2.2ob&')
iodial = winio@ ('A check box%cb&')
!1a iodial = winio@ ('%rb[]%cb&', gcswit) iodial = winio@ ('%^rb[]%cb&', gcswit, greyme)!2b
iodial = winio@ ('A %%rd controlled by it%cb&')
iodial = winio@ ('%dd&', 1)
iodial = winio@ ('%il&', 1, 9)
!1b iodial = winio@ ('%~rd&', tintin, gcswit)
iodial = winio@ ('%rd&', tintin)!2a
iodial = winio@ ('%lc&', gchand)!2b
iodial = winio@ ('%cb')
stop
end program grey_doubt
module grey_day
integer gcswit, gchand
contains
!------------------------------------------------ integer function greyme () stdcall greyio 'EnableWindow' (val, val) :logical logical greycn greyme = 2 greycn = (gcswit .eq. 1) if (greyio (gchand, greycn)) continue return end function greyme !------------------------------------------------ end module grey_day