Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

loaing an icon in window tool bar

Posted on 2003-03-02
4
Medium Priority
?
231 Views
Last Modified: 2013-11-20
how do i loading an icon into a toolbar using vc++

thanking
sudipta
0
Comment
Question by:sudipta_pal
1 Comment
 
LVL 2

Accepted Solution

by:
sreenu_v78 earned 100 total points
ID: 8056397
hai sudipta

go thru "insert"-->resource editor and add toolbar

and insert icons for  toolbarbuttons..

use this function
LoadToolBar()

//add this code OnCreate Method
m_wndToolBar.LoadToolBar(IDR_TOOLBAR1);

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
     if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
          return -1;
     
     if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
          | CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
          !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
     {
          TRACE0("Failed to create toolbar\n");
          return -1;      // fail to create
     }

     if (!m_wndStatusBar.Create(this) ||
          !m_wndStatusBar.SetIndicators(indicators,
            sizeof(indicators)/sizeof(UINT)))
     {
          TRACE0("Failed to create status bar\n");
          return -1;      // fail to create
     }

     // TODO: Delete these three lines if you don't want the toolbar to
     //  be dockable
     m_wndToolBar.LoadToolBar(IDR_TOOLBAR1);
     m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
     EnableDocking(CBRS_ALIGN_ANY);
     DockControlBar(&m_wndToolBar);

     return 0;
}


best wishes.

sreenu.
sreenu_v78@yahoo.com




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: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
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 summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .

579 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