Frage

Is this possible to do and have each set control separate code?

What I'm looking to achieve is ask two questions in a single messagebox which is easy to do but how would I give functionality to each button and prevent the messagebox from closing upon answering one of the questions?

This is question 1
  Yes    No

This is question 2
  Yes    No

Is there a way to prevent the messagebox from closing if you answer question 1 as yes and not close unless they answer the 2nd question?

War es hilfreich?

Lösung

You can't do this with MessageBox as-is. You'd have to create a custom dialog box.

You could always check the result of messagebox1 and have it control the following logic for messagebox2 to display or not?

Dim result = MsgBox("This is question 1")
If result = MsgBoxResult.Ok Then
    'do something
End If

Andere Tipps

design it exactly how you want and call the from as dialog. Testfrom.showdialog() when done that way you can capture the results and decide when to close the from based on users selections

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top