VB.net中的MessageBox持久性

|| 我正在使用“ 0”向用户提供一些信息,但是当弹出这样的框时,我希望它阻止对主窗口的访问。因此,在用户单击\“ OK \”之前,他们应该不能单击(甚至关注)其下方的窗口。 有人知道怎么做这个吗?我注意到ѭ0的功能很少,所以也许我什至不得不使用其他对象。     
已邀请:
        快速而肮脏的解决方案可以是对话框表单(项目->添加Windows表单->对话框)。这使您可以可视地扩展MessageBox。 您可以调用MessageBox的ShowDialog方法,它当然会阻止对父窗口的访问。 当然还有其他方法。 例:
\' This is your Dialog you created by going Project->Add Windows Form->Dialog
Public Class MessageBoxDialog

  Public Overloads Sub ShowDialog(ByVal message As String)

    Me.txtMessage.Text = message

    ShowDialog()

  End Sub
End Class

\' This is the form you want to call the message box on
Private Sub btnShowMsgBox_Click(sender As System.Object, e As System.EventArgs) _
                                Handles btnShowMsgBox.Click
    Dim messageBox As New MessageBoxDialog
    messageBox.ShowDialog(\"This is another way to show a MsgBox but allows greater extensibility.\")
End Sub
    
        在我张贴在这里之后,我的朋友想出了答案。通过调用以mf为主要形式的
MessageBox.Show(mf, \"text\")
,只要未单击OK按钮,就会禁用mf。我想这个问题毕竟有点愚蠢,但是我希望如果其他人也遇到同样的问题,这可能会有所帮助。     

要回复问题请先登录注册