Load image on tooBars toolbuttons.
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: Load image on tooBars toolbuttons.

  1. #1
    Join Date
    Sep 2007
    Location
    Bangalore,India
    Posts
    163

    Smile Load image on tooBars toolbuttons.

    Dear Friends
    I am having trouble in placing images on the toolBar toolbuttons. The option is there to load a palette but there's no option for loading an image file onto the toolButtons. Please tell me if there's a ready made way to load an image icon on the toolbuttons. Thanks a lot in advance.

  2. #2
    ovidiucucu's Avatar
    ovidiucucu is offline Moderator/Reviewer Power Poster
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,019

    Re: Load image on tooBars toolbuttons.

    Your question is far away to be clear.
    Are you using MFC, raw-WinAPI or something else?
    Where/in which function did you find "an option to load a palette but no option for loading an image file"?
    Please, clarify!
    Ovidiu Cucu
    "When in Rome, do as Romans do."
    Visit: Microsoft Virtual Academy
    Follow: https://twitter.com/#!/ovidiucucu
    My blog: http://codexpert.ro/blog/author/ovidiu-cucu/

  3. #3
    Join Date
    Sep 2007
    Location
    Bangalore,India
    Posts
    163

    Re: Load image on tooBars toolbuttons.

    I am using MFC. VC++...........I am loading a toolBar like this

    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_TOOLBAR1))
    {
    TRACE0("Failed to create toolbar\n");
    return -1; // fail to create
    }

    m_wndToolBar.LoadToolBar(IDR_TOOLBAR1);
    m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
    EnableDocking(CBRS_ALIGN_ANY);
    DockControlBar(&m_wndToolBar);

    Then using rosource option I am able to create variouis toolbuttons on the toolbar applying event-handling. But how can I put different pictures/images on the toolbuttons. I dont find interesting to use palette. Can we use ready made image files. like png, jpeg etc. Thanks sujan

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    17,269

    Re: Load image on tooBars toolbuttons.

    Quote Originally Posted by sujan.dasmahapatra View Post
    I dont find interesting to use palette. Can we use ready made image files. like png, jpeg etc. Thanks sujan
    You could just open these image files in some editor and then copy/paste pictures to your toolbar button...
    Victor Nijegorodov

  5. #5
    Join Date
    Sep 2007
    Location
    Bangalore,India
    Posts
    163

    Re: Load image on tooBars toolbuttons.

    Its not possible just copy and paste. do u know MFC VC++ 2005.....This is not enabled.

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,062

    Re: Load image on tooBars toolbuttons.

    Open your toolbar resource in the resource editor of Visual Studio.
    Then you can edit each image for each button and then you can copy/paste images from other programs into a button.
    Or you can use a toolbar image editor, for example I'm using Axialis IconWorkshop and it's very easy to use.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center