
Add a button dynamically on the creation of a Dialog Box
Other thoughts .. make the property page a sub-dialog (child dialog) of the
modal dialog (which only has OK and Cancel).
That way, you either put the property page in a property sheet (which has
its own OK and Cancel), or you put in as a child dialog of the (almost)
empty modal dialog that has its own OK and Cancel buttons.
Then the behavior (as far as the property page is concerned) is the same.
You can probably also have the same class for it as well.
--
Roger Onslow
Software Developer
See my articles at http://www.codeguru.com
See the product I am working on at http://www.swishzone.com
"Operator .. give me the number for 911" .. Homer Simpson
Quote:
> Use a flag in your dialog class which you set according to your needs. In
> OnInitDialog, after calling CDialog::OnInitDialog, check the flag and
create
> the buttons accordingly. At this moment in time, your dialog is already
> created.
> Dan
> > I want to add a button in a dialog box but dynamically. The problem I
am
> > experiencing is that when I add the button the dialog box is not created
> > yet.
> > I am using a modal dialog box.
> > If there is no way to do this maybe I can remove a button dynamically...
> > What I want to do is to use the same dialog in a property page and in a
> > modal dialog box but I don't want to have two set of "ok /cancel"
button.
> > Thanks in advance,
> > Keaven