Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling Text Control

Status
Not open for further replies.

Frink

Programmer
Mar 16, 2001
798
GB
Hallo,

I have a dialog box with a button and a text box and I want to be able to disable either control. By disable I mean make grey and unclickable.

I have the following code:
Code:
DDX_Control(pDX, IDC_RESETBN, m_ResetBn);
DDX_Control(pDX, IDC_DNT, m_DateAndTime);

I can disable the Button with:
Code:
m_ResetBn.EnableWindow(false);

What's the code to disable m_DateAndTime?

Thanks in advance,

- Frink
 
Hallo,

Cheers, I know it looks obvious, and I did try that originally. But it works now.
The problem was that although my buttons were mapped to controls, my text box was mapped to a variable (or something like that, I don't know the exact terminology)

GetDlgItem(IDC_DNT)->EnableWindow(false);

did the trick,

- Frink
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top