The system colors in Visual C++ don't seem to be very representative of the actual colors on the dialog (I tried using them programatically as well as through the properties and they still don't match the background of the dialog). I did figure out how you can match the background of the graph to the background of the dialog, but doing anything with the background color of the dialog requires handling the WM_CTLCOLOR message, so it's kind of hairy.
Basically, what you want to do is this:
1. Declare a CNiColor member in your Dialog (I called it cnicolor for this example). You just need this to pass the color from the message handler to the OnInitDialog function.
2. Put a statement in your OnInitDialog that looks something like:
mygraph.
SetPlotAreaColor(cnicolor);
3. Create a handler for the WM_CTCOLOR message on your dialog (it should create a function called OnCtlColor).
4. Use the following code for the function:
HBRUSH Ctest2Dlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
COLORREF color;
color = GetBkColor(pDC->Detach());
cnicolor = CNiColor(color);
return hbr;
}
This will make the background of the graph match the background of the Dialog. If you want to do it the other way around, just handle the same message and use pDC->setBkColor(COLORREF). Feel free to post here if you have any questions, or you can call or email Measurement Studio tech support and ask to speak to Ryan.