Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How can I put image into control bar...

Posted on 2002-07-01
7
Medium Priority
?
172 Views
Last Modified: 2013-11-20
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
0
Comment
Question by:wanlop
  • 3
  • 2
  • 2
7 Comments
 
LVL 12

Expert Comment

by:migel
ID: 7121508
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
 

Author Comment

by:wanlop
ID: 7123497
yes I would like to insert  background image into Dialogbar.
please suggest me.
thank
0
 
LVL 8

Expert Comment

by:fl0yd
ID: 7123567
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:wanlop
ID: 7123628
do you have some sample?
0
 
LVL 12

Expert Comment

by:migel
ID: 7123907
Hi!
You can use same tecnique as for CDialog did you try this?
0
 
LVL 8

Accepted Solution

by:
fl0yd earned 400 total points
ID: 7123918
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
 

Author Comment

by:wanlop
ID: 7124171
Thanks it's work
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question