CFormView Class with Custom Background Color
Posted
by Patty You
on October 1st, 2002
CColorFormView is derived from CFormView with custom background color.
How to use CColorFormView class in your project?
1)Derive your form view class from CColorFormView class. For example:class CMyFormView : public CColorFormView2)Change form view background color: You can specify background color in your form view's OnInitialUpdate():
void CMyFormViewView::OnInitialUpdate()
{
SetWindowText(_T("This is my formview"));
CColorFormView::OnInitialUpdate();
// set color to your form view
SetBackgroundColor(RGB(0, 128, 0));
// make the parent frame fit the form template
GetParentFrame()->RecalcLayout();
ResizeParentToFit();
}
I hope you enjoy this little class.

Comments
There are no comments yet. Be the first to comment!