Buttons are disabled on dialog templates,.
-
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!"
-
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!"
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.
-
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!"
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
-
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
-
Well, actually i did have a handler for the buttons already.. specifically the OnButtonClicked handler.. tnx anyways.. :)
-
Well, actually i did have a handler for the buttons already.. specifically the OnButtonClicked handler.. tnx anyways.. :)
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