Discussion:
Create CView in MDI
(too old to reply)
smaryus
2007-03-15 12:15:00 UTC
Permalink
If I make an application in doc/view architecture and i have only one CView
derived class (CMyView).
The menu to create new child windows is like this:

Create window
Bkgrnd Black
Bkgrnd Yellow
Bkgrnd red
......

When it's selected "Bkgrnd red" the new created CMyView will have the
background red, for black will be black an so on.

I have to create a class from CView for every color, or how can be send to
CMyView a parameter and based on his value when the window is created to set
the background color?
Ajay Kalra
2007-03-16 02:18:25 UTC
Permalink
To change the background color of a CView, override OnEraseBkgnd and paint
it with color of your choice and return TRUE. See more here:

http://support.microsoft.com/kb/103786

To create a new frame/view in MDI, use CreateNewFrame. See here:

http://support.microsoft.com/kb/100993

--
Ajay Kalra [MVP - VC++]
Post by smaryus
If I make an application in doc/view architecture and i have only one CView
derived class (CMyView).
Create window
Bkgrnd Black
Bkgrnd Yellow
Bkgrnd red
......
When it's selected "Bkgrnd red" the new created CMyView will have the
background red, for black will be black an so on.
I have to create a class from CView for every color, or how can be send to
CMyView a parameter and based on his value when the window is created to set
the background color?
Loading...