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. Buttons are disabled on dialog templates,.

Buttons are disabled on dialog templates,.

Scheduled Pinned Locked Moved C / C++ / MFC
wpfquestionlearning
6 Posts 3 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.
  • M Offline
    M Offline
    Maverick
    wrote on last edited by
    #1

    Hello.. I made a dialog resource with three CButton's and a CEdit for use on a CDialogBar.. the dialog resource is set to WS_CHILD.. Now when i used the resource on a CDialogBar.. and i used CDialogBar directly without subclassing it, the buttons is always disabled... But i didn't set it to disabled on the resource editor.. Why is this? The scenario is that I have a CDockBar docked on a mainframe, and i placed a LayeredCWnd on it as its child..Now the LayeredCWnd has the CDialogBar as its child.. Then when i run the program the buttons in the dialogbar is always disabled, while the Edit control is not.. "WatcH the BIrDiE!"

    M K 2 Replies Last reply
    0
    • M Maverick

      Hello.. I made a dialog resource with three CButton's and a CEdit for use on a CDialogBar.. the dialog resource is set to WS_CHILD.. Now when i used the resource on a CDialogBar.. and i used CDialogBar directly without subclassing it, the buttons is always disabled... But i didn't set it to disabled on the resource editor.. Why is this? The scenario is that I have a CDockBar docked on a mainframe, and i placed a LayeredCWnd on it as its child..Now the LayeredCWnd has the CDialogBar as its child.. Then when i run the program the buttons in the dialogbar is always disabled, while the Edit control is not.. "WatcH the BIrDiE!"

      M Offline
      M Offline
      Marc Soleda
      wrote on last edited by
      #2

      I don't understand why it's happenning but you could force to enable these controls when you initializes the dialog (OnInitDialog): m_button.EnableWindow(true); m_edit.EnableWindow(true); Hope it helps, Marc Soleda ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.

      1 Reply Last reply
      0
      • M Maverick

        Hello.. I made a dialog resource with three CButton's and a CEdit for use on a CDialogBar.. the dialog resource is set to WS_CHILD.. Now when i used the resource on a CDialogBar.. and i used CDialogBar directly without subclassing it, the buttons is always disabled... But i didn't set it to disabled on the resource editor.. Why is this? The scenario is that I have a CDockBar docked on a mainframe, and i placed a LayeredCWnd on it as its child..Now the LayeredCWnd has the CDialogBar as its child.. Then when i run the program the buttons in the dialogbar is always disabled, while the Edit control is not.. "WatcH the BIrDiE!"

        K Offline
        K Offline
        krmed
        wrote on last edited by
        #3

        One reason they may be disabled is that there is no handler for them. Since you say the DialogBar is on your MainFrame, add handlers in the MainFrm class for the buttons. I'm assuming MFC here, and MFC automatically disables items it can't find a handler for. Hope that helps. Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

        M 1 Reply Last reply
        0
        • K krmed

          One reason they may be disabled is that there is no handler for them. Since you say the DialogBar is on your MainFrame, add handlers in the MainFrm class for the buttons. I'm assuming MFC here, and MFC automatically disables items it can't find a handler for. Hope that helps. Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

          M Offline
          M Offline
          Maverick
          wrote on last edited by
          #4

          Well, actually i did have a handler for the buttons already.. specifically the OnButtonClicked handler.. tnx anyways.. :)

          M K 2 Replies Last reply
          0
          • M Maverick

            Well, actually i did have a handler for the buttons already.. specifically the OnButtonClicked handler.. tnx anyways.. :)

            M Offline
            M Offline
            Maverick
            wrote on last edited by
            #5

            hey, thats a good idea.. im gonna try that.. tnx:) but still want to know why the buttons are disabled by default when im using dialog bars -- not dialog boxes.. regards, Maverick "wATCh THe BirDIe!..."

            1 Reply Last reply
            0
            • M Maverick

              Well, actually i did have a handler for the buttons already.. specifically the OnButtonClicked handler.. tnx anyways.. :)

              K Offline
              K Offline
              krmed
              wrote on last edited by
              #6

              Is the handler in your MainFrm class or some other class. Since the DialogBar is in the MainFrame, that's where the handler needs to be. If it is there, I'm at a loss why the button is disabled. Good luck. Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

              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