Thanks for your interest.
I am not using a property page.
I simply edited the dialog resource for CFormView,
and placed a tab ctrl on it with id: IDC_TAB
Cheers,
-c
Main Topics
Browse All TopicsI have managed to alter the color of my CFormView subclass to black.
However, the tab control is problematic because I do not know how to make
it draw black in the top left (I mean 'top-right') portion of its space,
and that area is supposed to blend with the form.
What can I do?
Best regards,
-c
My best effort so far is this, which seems to be inadequate....
HBRUSH CNavigatorView::OnCtlColor
{
if(
(pWnd->GetDlgCtrlID() == IDC_TAB)
||
(nCtlColor == CTLCOLOR_DLG )
)
{
pDC->SetBkColor(RGB(0,0,0)
static HBRUSH hBlackBrush = HBRUSH(CBrush(RGB(0,0,0)))
return hBlackBrush;
}
HBRUSH hbr = CFormView::OnCtlColor(pDC,
return hbr;
}
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
i have a project that changes the background of a control i can send it to you and you can figure out how to make things work. Here is what i gathered from that project.
in your controls header file
CBrush backbrush;
in your controls contructor put this
backBrush.CreateSolidBrush
Instead of the control put it into the Formview contructor and see what that does. Also if your control has a constructor put it there instead. i can send the code to you so that you can investigate further
i will send the source to you. better yet i will send you the link where i found it. there is a nice article describing it.
http://www.codeproject.com
in this article he changes the background of a listctrl. it shouldn't be that hard to modify it for use in your code!
>>I believe the static keyword ensures that
>>the object will live until program termination,
>>which explains why there was no improvement.
I think it doesnt ensure , all it ensures is that hBlackBrush maintains its value across function calls but that doesnt stop the destructor for CBrush from deleting the brush object. So the handle that you store does become invalid.
To test ambience's theory about the Handle becoming invalid after the brush has gone out of scope (which I consider a very insightful concern), I changed the relevant code to this...
static CBrush blackBrush(RGB(0,0,0))
static HBRUSH hBlackBrush = HBRUSH(blackBrush)
and this did not help.
It think the point is insightful and possibly correct.
But some other obstacle remains.
Thanks for your thoughtful suggestions,
-c
Thanks also to simongod. I am studying the example to see what light it might shed. Thanks!!!
-c
Dear cternoey
I think you forgot this question. I will ask Community Support to close it unless you finalize it within 7 days. You can always request to keep this question open. But remember, experts can only help you if you provide feedback to their questions.
Unless there is objection or further activity, I will suggest to accept
"simongod"
comment(s) as an answer.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
======
Werner
Business Accounts
Answer for Membership
by: simongodPosted on 2001-01-25 at 14:19:28ID: 188885
when you speak of a TAB do you mean a PropertySheet/PropertyPage ?
If thats the case then i can provide you with the proper info. If you used a TAB control (which is different) then i have to look at other stuff to help provide the best answer. More info is needed