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. dialog button disabled !!!!

dialog button disabled !!!!

Scheduled Pinned Locked Moved C / C++ / MFC
helpc++questionlearning
7 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.
  • V Offline
    V Offline
    venadder
    wrote on last edited by
    #1

    Hi, I have an MDI MFC VS2005 app. I added a dialog bar in resource view and changed the basze class from CDialog to CDialogBar. I use following code to create the dialogbar. Now it is created fine and it aligns at bottom as intended, but all the buttons on the dialogbar are disabled!!!. What's going on here? int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; EnableDocking(CBRS_ALIGN_ANY); m_launchbar.Create( this, IDD_LAUNCHBAR, CBRS_BOTTOM , IDD_LAUNCHBAR ); } In addition to the above problem the OnShowWindow is fired only when exiting the app and never when the app is started. IMPLEMENT_DYNAMIC(CLaunchbar, CDialogBar) CLaunchbar::CLaunchbar(CWnd* pParent /*=NULL*/) : CDialogBar() { } CLaunchbar::~CLaunchbar() { } void CLaunchbar::DoDataExchange(CDataExchange* pDX) { CDialogBar::DoDataExchange(pDX); DDX_Control(pDX, IDC_LBREXITAPP, m_lbrExitApp); } BEGIN_MESSAGE_MAP(CLaunchbar, CDialogBar) ON_WM_SHOWWINDOW( ) ON_BN_CLICKED(IDC_LBREXITAPP, &CLaunchbar::OnBnClickedLbrexitapp) END_MESSAGE_MAP() // CLaunchbar message handlers void CLaunchbar::OnShowWindow( BOOL bShow, UINT nStatus ) { } void CLaunchbar::OnBnClickedLbrexitapp() { // TODO: Add your control notification handler code here } Any help please?

    N 1 Reply Last reply
    0
    • V venadder

      Hi, I have an MDI MFC VS2005 app. I added a dialog bar in resource view and changed the basze class from CDialog to CDialogBar. I use following code to create the dialogbar. Now it is created fine and it aligns at bottom as intended, but all the buttons on the dialogbar are disabled!!!. What's going on here? int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CFrameWnd::OnCreate(lpCreateStruct) == -1) return -1; EnableDocking(CBRS_ALIGN_ANY); m_launchbar.Create( this, IDD_LAUNCHBAR, CBRS_BOTTOM , IDD_LAUNCHBAR ); } In addition to the above problem the OnShowWindow is fired only when exiting the app and never when the app is started. IMPLEMENT_DYNAMIC(CLaunchbar, CDialogBar) CLaunchbar::CLaunchbar(CWnd* pParent /*=NULL*/) : CDialogBar() { } CLaunchbar::~CLaunchbar() { } void CLaunchbar::DoDataExchange(CDataExchange* pDX) { CDialogBar::DoDataExchange(pDX); DDX_Control(pDX, IDC_LBREXITAPP, m_lbrExitApp); } BEGIN_MESSAGE_MAP(CLaunchbar, CDialogBar) ON_WM_SHOWWINDOW( ) ON_BN_CLICKED(IDC_LBREXITAPP, &CLaunchbar::OnBnClickedLbrexitapp) END_MESSAGE_MAP() // CLaunchbar message handlers void CLaunchbar::OnShowWindow( BOOL bShow, UINT nStatus ) { } void CLaunchbar::OnBnClickedLbrexitapp() { // TODO: Add your control notification handler code here } Any help please?

      N Offline
      N Offline
      Nibu babu thomas
      wrote on last edited by
      #2

      venadder wrote:

      Now it is created fine and it aligns at bottom as intended, but all the buttons on the dialogbar are disabled!!!. What's going on here?

      Write event handlers for the buttons.


      Nibu thomas Software Developer

      V 1 Reply Last reply
      0
      • N Nibu babu thomas

        venadder wrote:

        Now it is created fine and it aligns at bottom as intended, but all the buttons on the dialogbar are disabled!!!. What's going on here?

        Write event handlers for the buttons.


        Nibu thomas Software Developer

        V Offline
        V Offline
        venadder
        wrote on last edited by
        #3

        already have event handlers for on click as folows: public: afx_msg void OnBnClickedLbrexitapp(); void CLaunchbar::OnBnClickedLbrexitapp() { // TODO: Add your control notification handler code here }

        H N 2 Replies Last reply
        0
        • V venadder

          already have event handlers for on click as folows: public: afx_msg void OnBnClickedLbrexitapp(); void CLaunchbar::OnBnClickedLbrexitapp() { // TODO: Add your control notification handler code here }

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          you created button and declare function for buttons but buttons are disable,right?

          1 Reply Last reply
          0
          • V venadder

            already have event handlers for on click as folows: public: afx_msg void OnBnClickedLbrexitapp(); void CLaunchbar::OnBnClickedLbrexitapp() { // TODO: Add your control notification handler code here }

            N Offline
            N Offline
            Nibu babu thomas
            wrote on last edited by
            #5

            venadder wrote:

            void CLaunchbar::OnBnClickedLbrexitapp()

            You must provide a message handler in the MainFrame class not in the DialogBar class.


            Nibu thomas Software Developer

            V 1 Reply Last reply
            0
            • N Nibu babu thomas

              venadder wrote:

              void CLaunchbar::OnBnClickedLbrexitapp()

              You must provide a message handler in the MainFrame class not in the DialogBar class.


              Nibu thomas Software Developer

              V Offline
              V Offline
              venadder
              wrote on last edited by
              #6

              Thanx for your input. I changed it from dialog bar to CDialog anywyas. I have much more control and flexibility that way. It's easy to position teh window even with CDialog. But thanx for your help. I appreciate it.

              N 1 Reply Last reply
              0
              • V venadder

                Thanx for your input. I changed it from dialog bar to CDialog anywyas. I have much more control and flexibility that way. It's easy to position teh window even with CDialog. But thanx for your help. I appreciate it.

                N Offline
                N Offline
                Nibu babu thomas
                wrote on last edited by
                #7

                venadder wrote:

                I changed it from dialog bar to CDialog anywyas. I have much more control and flexibility that way. It's easy to position teh window even with CDialog.

                Why oh why!!! Then what is the use of a Dialog bar!!!:sigh: You just have to provide a message handler for the button in the main frame class. That's all. Nothing more nothing less. Just like you would do for a toolbar button.:)


                Nibu thomas Software Developer

                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