Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Ctoolbar button problem

Ctoolbar button problem

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpcareer
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gopalraja
    wrote on last edited by
    #1

    I have a created a SDI Application and 4 toolbar buttons are there, in that one button is PAUSE/RESUME button(Like a Toggle button). So when clikced PAUSE button means I have to change to RESUME image and Vice-versa. I have done it by using CImagList::Replace(index, IC_PASUSE). Now i have created the modeless dialog and it contains one CButton. Her my aim to change the image of the Toolbar PAUSE/RESUEME button when i cliked that CButton in the Modeless dialog. For that I wrote same code that is CImageList::Replace(), But when i cliked that CButton in the modeless dialog , the image is not changing in the Toolbar PAUSE/RESUME button, but when i moves the mouse on the ToolBar PASU/RESUME button, that image is replacing perfectly. provide me the solution.

    S 1 Reply Last reply
    0
    • G gopalraja

      I have a created a SDI Application and 4 toolbar buttons are there, in that one button is PAUSE/RESUME button(Like a Toggle button). So when clikced PAUSE button means I have to change to RESUME image and Vice-versa. I have done it by using CImagList::Replace(index, IC_PASUSE). Now i have created the modeless dialog and it contains one CButton. Her my aim to change the image of the Toolbar PAUSE/RESUEME button when i cliked that CButton in the Modeless dialog. For that I wrote same code that is CImageList::Replace(), But when i cliked that CButton in the modeless dialog , the image is not changing in the Toolbar PAUSE/RESUME button, but when i moves the mouse on the ToolBar PASU/RESUME button, that image is replacing perfectly. provide me the solution.

      S Offline
      S Offline
      Stuart Dootson
      wrote on last edited by
      #2

      You need to inform the main frame (or something) that the state of that command button has changed - maybe this page[^] can help? You should probably not change the image list directly, instead send a message to the main frame telling it about the state change. Then it can manage the change to its UI.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups