Solved

How can I put image into control bar...

Posted on 2002-07-01
7
160 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
Comment Utility
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
Comment Utility
yes I would like to insert  background image into Dialogbar.
please suggest me.
thank
0
 
LVL 8

Expert Comment

by:fl0yd
Comment Utility
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

Author Comment

by:wanlop
Comment Utility
do you have some sample?
0
 
LVL 12

Expert Comment

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

Accepted Solution

by:
fl0yd earned 100 total points
Comment Utility
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
Comment Utility
Thanks it's work
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now