Without knowing more about the OS and class libraries, a specific answer isn't possible, but in general, you'd want to create the different dialogs and show them and hide them as necessary. Then you can use IsWindowVisible to see which dialogs, if any, are being displayed and control the behavior accordingly - assuming this is a Windows app.