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. Updating toolbar buttons or menu

Updating toolbar buttons or menu

Scheduled Pinned Locked Moved C / C++ / MFC
c++architectureannouncement
4 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.
  • R Offline
    R Offline
    Rno35
    wrote on last edited by
    #1

    Hi, Here it goes: the user of my program click a button of a toolbar. Then a function is executed corresponding to this button. I am using a document/view architecture with VC++ 6 and I am able to change the state of the button (i.e. grayed, checked…) only once the function is finished. I would like to be able to update the state of the toolbar button of menu while executing the function: void CMyProjectView::OnButtonDown() { // initialize variables // change the state of toolbar buttons // Do code here // restore the starting state of toolbar buttons } Thanks, Rno

    J 1 Reply Last reply
    0
    • R Rno35

      Hi, Here it goes: the user of my program click a button of a toolbar. Then a function is executed corresponding to this button. I am using a document/view architecture with VC++ 6 and I am able to change the state of the button (i.e. grayed, checked…) only once the function is finished. I would like to be able to update the state of the toolbar button of menu while executing the function: void CMyProjectView::OnButtonDown() { // initialize variables // change the state of toolbar buttons // Do code here // restore the starting state of toolbar buttons } Thanks, Rno

      J Offline
      J Offline
      John R Shaw
      wrote on last edited by
      #2

      EnableWindow() INTP

      R 1 Reply Last reply
      0
      • J John R Shaw

        EnableWindow() INTP

        R Offline
        R Offline
        Rno35
        wrote on last edited by
        #3

        I am looking into it but it is not working... Do you have another suggestion? Thanks, Rno

        J 1 Reply Last reply
        0
        • R Rno35

          I am looking into it but it is not working... Do you have another suggestion? Thanks, Rno

          J Offline
          J Offline
          John R Shaw
          wrote on last edited by
          #4
          1. Create an OnUpdateButton() for the button you want to disable. 2) Type in pCmdUI->Enable(FALSE); ( or pCmdUI->Enable(); ). 3) Place a break point on step (2). 4) Run your application in debug and start stepping. OR 1) Goto the MFC\SRC directory 2) Open BARTOOL.CPP 3) Search for CToolCmdUI::Enable You should have no problem figuring it out from there. I hoped this helped! INTP
          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