I want to create buttons during runtime.... the number of buttons may vary... but how can I create them on my dialog ??
Printable View
I want to create buttons during runtime.... the number of buttons may vary... but how can I create them on my dialog ??
Use CreateWindow with a window class of "button". Pass the dialog window's HWND as the parent window to the button. You will likely need to make the dialog window resizeable to accomodate a large number of buttons.
Of course, instead of a dialog, you could just create your own frame or popup window and host the button controls there.
-rick
Furthermore, define the ID for the controls at compile-time.
Kuphryn