MFC: DialogBar's and simple buttons? 
Author Message
 MFC: DialogBar's and simple buttons?

I used the Project/Add To Project/Components and Controls
to add a "Dialog Bar" to an MDI child frame.

I can add any control to the dialog bar (using the resource editor)
and they work fine... all except a simple button.  Buttons appear
inactive.

Does anyone know what doing on here?  How do I get
buttons to work in this context?

Carlos



Mon, 31 Jul 2000 03:00:00 GMT  
 MFC: DialogBar's and simple buttons?


Fri, 19 Jun 1992 00:00:00 GMT  
 MFC: DialogBar's and simple buttons?

Carlos,
    The button is inactive because you have to add an ON_UPDATE_COMMAND_UI
for the button - just as though the button were a menu command.  It oughtta
look something like this

BEGIN_MESSAGE_MAP(CYourView, CView)
  ON_UPDATE_COMMAND_UI(IDC_BUTTON1, OnUpdateButton1)
  ON_COMMAND(IDC_BUTTON1, OnButton1)
END_MESSAGE_MAP

void CYourView::OnUpdateButton1(CCmdUI *pCmdUI)
{
    pCmdUI->Enable(TRUE);

Quote:
}

void CYourView::OnButton1()
{
    TRACE("Dialog bar button1 pressed\n");

Quote:
}

--
Spam-resistant return address...
Remove .Spleen to reply
Doug
Quote:

>I used the Project/Add To Project/Components and Controls
>to add a "Dialog Bar" to an MDI child frame.

>I can add any control to the dialog bar (using the resource editor)
>and they work fine... all except a simple button.  Buttons appear
>inactive.

>Does anyone know what doing on here?  How do I get
>buttons to work in this context?

>Carlos



Tue, 01 Aug 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. DialogBar's and Simple Buttons???

2. Dialogbar's Button

3. Buttons in DialogBar won't work in VC++6

4. Buttons don't work on dialogBar

5. Button on Dialogbar won't react!!!!

6. Dialogbar's Button

7. Simple DialogBar question

8. Simple DialogBar question

9. The button on DialogBar is disabled???

10. Beginner: Bitmap button in SDI dialogbar

11. Disabling Buttons on a DialogBar (newbie question)

12. disable DialogBar buttons

 

 
Powered by phpBB® Forum Software