🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #467

Disabling Autoradiobuttons at run time - TPW

#467
From: Nick de Kock
Date: Thu, 13 Aug 1992 07:43
25 lines
1337 bytes
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...........
Technical Details
Message-ID: <dekock.713691787@shannon>
Path: arc1-ca.pugleaf.net!sparky!uunet!psgrain!hippo!shannon!shannon!dekock

Show Full Headers
Complete Article Headers
Newsgroups: comp.windows.ms.programmer,comp.lang.pascal
Path: arc1-ca.pugleaf.net!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