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
Maximize form
Posted by Legacy on 07/16/2002 12:00amOriginally posted by: alenbabu
ReplyHow can I paint the bgcolor in WIN CE 3.0?
Posted by Legacy on 01/18/2002 12:00amOriginally posted by: kang ilkoo
In win ce 3.0 MFC , there is no SetBackgroundColor method...
Reply
Bestway to paint the background colo
Posted by Legacy on 11/12/2001 12:00amOriginally posted by: Pat Tharmarajah
ReplyBestway to paint the background colo
Posted by Legacy on 11/12/2001 12:00amOriginally posted by: Pat Tharmarajah
Do
the following in your MFC CFormView class
HBRUSH CFormView::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CFormView::OnCtlColor(pDC, pWnd, nCtlColor);
// you can choos any color
return(::CreateSolidBrush(RGB(77,0,77)));
// TODO: Return a different brush if the default is not desired
Replyreturn hbr;
}
Simple Formview BG Color
Posted by Legacy on 08/14/2001 12:00amOriginally posted by: Mark Clouden
Replyhow to do the First step??I dun get it....
Posted by Legacy on 03/25/2001 12:00amOriginally posted by: stephen
is that actually put "class CMyFormView : public CColorFormView" in the View header file or what..
i dun know how to derive my form view class from CColorFormView class!!~~thank you
ReplyProblem with EditView
Posted by Legacy on 01/28/2001 12:00amOriginally posted by: Rajasekhar
Hello!
I am developing an application in eVC 3.0 using document/view architecture.My main view is CView.It's working fine.I have one more screen with base calss as CEditView.It's working fine to write something and to save.But when i tried to open a file, after selecting the file name, this view getting disappeared and the main view is coming up.How to keep the CEditView as the top view until i want.I am not implementing the Open Dialog functionality.
I have a from with CFormView as the base class.I don't want the default scroll bars.How to remove them.
When i implemented the Open Dialog functionality it's not showing the files available in a directory.What might be the problem?
Please help me in this regard.
Please send mail to chavasekhar@rediffmail.com
Thanking you,
Rajasekhar
ReplyScreen Flashing?...Try this..
Posted by Legacy on 05/11/2000 12:00amOriginally posted by: Seung Wook, Hong
ReplyScreen flashing
Posted by Legacy on 05/11/2000 12:00amOriginally posted by: Tong Chen
I used your idea on CView, it worked. There is only one question: screen is always flashing when I resize the child windlow. Do you have any idea?
ReplyCFormView Class with Custom Background Color
Posted by Legacy on 05/06/2000 12:00amOriginally posted by: Fabrice
ReplyLoading, Please Wait ...