Adding controls to a Property Sheet at runtime (without Dialog Templates)

773 views Asked by At

As far as I can see, the way you normally create Property Sheets in Win32 (I am using the API, not MFC) programming is you have a bunch of dialog templates for each tab page, and you make the property sheet out of them. I have read about creating Dialog Templates 'in memory' but I would prefer not to do it this way. How do you add controls to a Property Sheet programatically at runtime, just like you can create a BUTTON and add it to a Window at runtime?

1

There are 1 answers

0
David Heffernan On BEST ANSWER

I suggest that you create a blank template and link that to your app. You can then create the property sheet with CreatePropertySheetPage and then add and remove controls to that property sheet as you please.

If you absolutely have to use a template built on the fly in memory, and you can't bring yourself to link a resource to your app, then you need the DLGTEMPLATE structure.