是否消息框OnTop

时间:2016-03-10 22:26:53

标签: vb.net

我正在尝试使用带有YesNo选项的MessageBox.Show命令。我需要的是它总是在顶部。

当前代码:

 Try
                Dim result As Integer = MessageBox.Show("Dsign has been reset. Would you like to make a ticket?", "Dsign", MessageBoxButtons.YesNo)

                If result = DialogResult.No Then
                    BGDsign.ReportProgress(100, "Dsign Reset")
                    Exit Sub
                ElseIf result = DialogResult.Yes Then
                End If

            Catch
            End Try

我知道如何使用Form.ShowDialog()但不确定如何为yesno消息框执行此操作。

1 个答案:

答案 0 :(得分:2)

而不是MessageBox.Show,请尝试此

Dim result As MsgBoxResult = MsgBox("Dsign has been reset. Would you like to make a ticket?", MsgBoxStyle.YesNo + MsgBoxStyle.SystemModal, "Dsign")