How can I put image into control bar...

Hi all,
   I have some question  about control bar, How can I put an images into control bar like a backgroud image. I saw
only turtorial  for image backgroud dialog.
pls advise me
thank you
wanlopAsked:
Who is Participating?
 
fl0ydCommented:
class CMyControlBar : public CControlBar {
public:
    afx_msg BOOL OnEraseBkgnd( CDC* pDC );
};

In your existing code replace CControlBar with this CMyControlBar-class after you implemented the drawing in OnEraseBkgnd. It's probably easier to use the class wizard to derive your class - but it can also be done manually. To get to your goal more easily break down your problem into subproblems: The first one is to actually be able to paint the background yourself. Don't worry about the image now; just call some simple drawing functions to see if it's working, some MoveTo's/LineTo's or FillSolidRect's are all you need to do. When that's working go on to the next task. Be warned though, displaying bitmaps holds more surprises than anyone would like to remember.
0
 
migelCommented:
Hi!
CControlBar is base class so it doesn`t draw anything - it just belongs on derived classe for painting.
Do you want insert bacground image into the toolbar or Dialogbar?
0
 
wanlopAuthor Commented:
yes I would like to insert  background image into Dialogbar.
please suggest me.
thank
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
fl0ydCommented:
You need to derive a class from CControlBar, lets call it CMyControlBar and override its CMyControlBar::OnEraseBkgnd( CDC* pDC )-function. Perform your desired drawing in this function and return TRUE.
0
 
wanlopAuthor Commented:
do you have some sample?
0
 
migelCommented:
Hi!
You can use same tecnique as for CDialog did you try this?
0
 
wanlopAuthor Commented:
Thanks it's work
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.