Adding buttons dynamically to a dialog 
Author Message
 Adding buttons dynamically to a dialog

    It's because of the CCmdUI stuff. Acts the same as the menu items. I
would go with Dirk's suggestion, and then also add an
ON_UPDATE_COMMAND_UI_RANGE handler for the same range of ids. - Doug S.

Quote:

> On Tue, 16 Jun 1998 20:06:01 +0200, "Dirk Djuga"

> >Just determine what is the max. number of buttons you will create, and
> >reserve a range of control IDs that is suitable.

> I have a solution.  Since the parent always gets the messages, then I
> can trap OnCommand() and determine manually which button was pressed.

> This works perfectly if I use CDialog.  But if I use CDialogBar, the
> button is disabled!  How can I enable the button?



Sun, 03 Dec 2000 03:00:00 GMT  
 Adding buttons dynamically to a dialog

Command messages from buttons on dialog bars go directly to the parent
window. Add them to the message map of your main frame or use the OnCommand
function.
VC++ enables the buttons automatically when there is a function attached to
that button. HTH.

Quote:

>On Tue, 16 Jun 1998 20:06:01 +0200, "Dirk Djuga"

>>Just determine what is the max. number of buttons you will create, and
>>reserve a range of control IDs that is suitable.

>I have a solution.  Since the parent always gets the messages, then I
>can trap OnCommand() and determine manually which button was pressed.

>This works perfectly if I use CDialog.  But if I use CDialogBar, the
>button is disabled!  How can I enable the button?



Fri, 08 Dec 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. adding buttons dynamically to a dialog

2. Add a button dynamically on the creation of a Dialog Box

3. add button to dialog dynamically

4. how to add button, edit control and spin button dynamically

5. Dynamically Created Checkbox Button Does Not Appear on Dialog

6. Problems with default button on a dynamically created dialog

7. Hiding a button in a Dialog dynamically

8. how to add edit ctrl and button into dialog dynimically

9. Adding a minimize button to an existing dialog based app

10. how can i add menu and button bar to a dialog

11. Steps to add bitmap to button in Dialog form

12. How to add dialog/buttons into a ListCtrl?

 

 
Powered by phpBB® Forum Software