Grant:
An alternative to the method that Chris suggested for specifying color properties of a National Instruments control is to programmatically modify the control's properties. A very simple and effective way to do this is to use MFC's CColorDialog class. This MFC dialog presents a palette to the user very similar to one you might see when configuring color properties of the Windows operating system. You could use this dialog to allow users the ability to customize the display colors of your application at run-time.
For example, I have written a simple dialog example that contains only a single National Instruments button control. In the Click event handler for this button, my code reads:
void CColorDlg::OnClickChangecolor()
{
CColorDialog
dlg(m_button.GetOffColor());
if(IDOK == dlg.DoModal())
{
m_button.SetOffColor(dlg.GetColor());
}
}
Every time the button is pressed, this code creates the CColorDialog as a modal dialog and sets the current color to reflect the current color settings of the button control. If the user presses the OK button then the button is changed to the color selected in the dialog.
Used with ComponentWorks and ComponentWorks++, prepackaged MFC dialogs like CColorDialog, CFontDialog, CFileDialog, CPageSetupDialog, and CFindReplaceDialog can often be used to quickly add professional features to your application.
Hope this helps,
Chris W.