Re: Background color of Command Objects in Win32
Two ways I found to make the C_TextIn and C_ComboBox commands have
white backgrounds, but unfortunately both require changes to the library
itself:
1. Comment out the line in vcmdpane.cpp (approx line 547) in
DynamicDlgProc
//case WM_CTLCOLOREDIT:
2. Make vCommandPane::DynamicDlgProc virtual. Subclass vCommandPane
and override DynamicDlgProc, such that it specifically handles this message,
and otherwise calls vCommandPane::DynamicDlgProc for default processing.
Upon receipt of a WM_CTLCOLOREDIT, it should call DefDlgProc(). Something
like:
int myCommandPane::DynamicDlgProc( HWND hDlg, UINT uMsg,
WPARAM wParam, LPARAM lParam )
{
if ( uMsg == WM_CTLCOLOREDIT )
return DefDlgProc( hDlg, uMsg, wParam, lParam );
return vCommandPane::DynamicDlgProc( hDlg, uMsg, wParam,
lParam );
}
Of course, if someone else has a solution that doesn't require
modifying the library, I'd like to hear about it.
thanks,
Andy Key
> Is there an easy way to set the background color of C_TextIn and
C_ComboBox
> controls on a command pane? When placed in a dialog box, these
command objects
> have a white background, yet on a command pane they have a grey
background.
> For an end-user, this could be quite confusing, as they might
assume that a C_TextIn
> is read only. When in the non-dropped down position, the combo
box text has a
> grey background, but when the associated list is displayed, it
uses a white
> background. Lists seem to always use the white background.
Reply to: