Place whatever controls you need to on the dialog form. Provide a public ShowDialog function to display the form and return a code indicating which button the user clicked.
Use a module-level variable m_ReturnValue to indicate the button the user clicked. Set this to vbCancel before displaying the form. Change it if the user clicks another button.
Note: If you really want this to behave like the Common Dialog Control, you can make an ActiveX control. Give it a form and make it display the form as described here. This will prevent the program from displaying the form using the Show method.
For more information on building custom controls, see my book Custom Controls Library.
|