home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / pascal / 4835 < prev    next >
Encoding:
Text File  |  1992-08-13  |  1.3 KB  |  36 lines

  1. Newsgroups: comp.windows.ms.programmer,comp.lang.pascal
  2. Path: sparky!uunet!psgrain!hippo!shannon!shannon!dekock
  3. From: dekock@shannon.ee.wits.ac.za (Nick de Kock)
  4. Subject: Disabling Autoradiobuttons at run time - TPW
  5. Message-ID: <dekock.713691787@shannon>
  6. Organization: Electrical Engineering, University of the Witwatersrand
  7. Date: 13 Aug 92 07:43:07 GMT
  8. Lines: 26
  9.  
  10. I have an application in which I require the selection of 1 out of 
  11. a series of options. Depending on certain conditions some of these
  12. options are unavailable at certain times. I need to disable certain
  13. of the buttons. I tried to do it like this but it didn't work for
  14. some reason:
  15. .
  16. procedure DisableButton(HDlg: HWnd; ButtonID: word);
  17.  
  18. var Stylebits: Word;
  19.     HControl: Word;
  20. begin
  21.   HControl := GetDlgItem(HDlg, ButtonID);
  22.   Stylebits := GetClassWord(HControl, gcw_Style);
  23.   SetClassWord(HControl, gcw_Style, Stylebits or ws_Disabled)
  24. end;
  25.  
  26. I call this during the dialog's SetUpWindow method but the buttons stay
  27. enabled. Any idea what I'm doing wrong?
  28.       
  29.     
  30. -- 
  31. Nick de Kock, High Voltage Group        | Internet dekock@odie.ee.wits.ac.za    
  32. Electrical Engineering, Wits University |                 or
  33. Johannesburg, South Africa              |      dekock@shannon.ee.wits.ac.za
  34. ....Another Churchill quote pending...........
  35.  
  36.