Hi Garry,
While working with MessageDialog in WeightCatcher, I noticed something that I think may be a limitation in the current implementation.
When I want to display only the Cancel button, for example, I leave ActionButtonCaption empty and only specify CancelButtonCaption:
Var dlg As New MessageDialog
dlg.ActionButtonCaption = ""
dlg.CancelButtonCaption = "Cancel"
dlg.AlternateActionButtonCaption = ""
dlg.Show()
I would expect this to display only the Cancel button. However, an OK Action button is automatically added as well.
This means that the developer cannot independently determine which of the Action, Cancel and Alternate buttons should be displayed.
I think it would be preferable to leave this decision entirely to the application developer. Depending on the purpose of the dialog, the developer may want to display an Action/OK button, a Cancel button, an Alternate button, any combination of these, or perhaps even no button at all. MessageDialog should ideally not add a button that the developer did not request.
Perhaps an empty caption could mean that the corresponding button is not displayed, or alternatively each button could have its own visibility property.
It would give developers much more control over the behaviour of MessageDialog while still keeping the API simple.
Kind regards,
ChrisRequest: Allow Full Control Over MessageDialog Buttons