Adding to the solution of Barneyman, if you're using Win32, you can use something like:
GetDlgItem (YOUR_CONTROL_ID_HERE)->EnableWindow(FALSE);
or the other alternate:
CWnd* myControl = GetDlgItem (YOUR_CONTROL_ID_HERE);
if(myControl)
{
myControl->EnableWindow (FALSE);
}