?
Solved

loaing an icon in window tool bar

Posted on 2003-03-02
4
Medium Priority
?
225 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

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…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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 tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
Suggested Courses

762 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