home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.windows.ms.programmer,comp.lang.pascal
- Path: sparky!uunet!psgrain!hippo!shannon!shannon!dekock
- From: dekock@shannon.ee.wits.ac.za (Nick de Kock)
- Subject: Disabling Autoradiobuttons at run time - TPW
- Message-ID: <dekock.713691787@shannon>
- Organization: Electrical Engineering, University of the Witwatersrand
- Date: 13 Aug 92 07:43:07 GMT
- Lines: 26
-
- I have an application in which I require the selection of 1 out of
- a series of options. Depending on certain conditions some of these
- options are unavailable at certain times. I need to disable certain
- of the buttons. I tried to do it like this but it didn't work for
- some reason:
- .
- procedure DisableButton(HDlg: HWnd; ButtonID: word);
-
- var Stylebits: Word;
- HControl: Word;
- begin
- HControl := GetDlgItem(HDlg, ButtonID);
- Stylebits := GetClassWord(HControl, gcw_Style);
- SetClassWord(HControl, gcw_Style, Stylebits or ws_Disabled)
- end;
-
- I call this during the dialog's SetUpWindow method but the buttons stay
- enabled. Any idea what I'm doing wrong?
-
-
- --
- Nick de Kock, High Voltage Group | Internet dekock@odie.ee.wits.ac.za
- Electrical Engineering, Wits University | or
- Johannesburg, South Africa | dekock@shannon.ee.wits.ac.za
- ....Another Churchill quote pending...........
-
-