showdialog的第一次异常
本文关键字:异常 第一次 showdialog | 更新日期: 2023-09-27 18:12:04
我有一个第一次异常错误,当我运行我的代码,我不知道为什么。我是Visual Studio的新手,我不知道我做错了什么。
由于我没有足够的分数来发布图像,这是错误的开始:
A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>Project Starter.vshost.exe</AppDomain><Exception><ExceptionType>System.InvalidOperationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>Form that is already visible cannot be displayed as a modal dialog box. Set the form's visible property to false before calling showDialog.</Message><StackTrace> at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
at System.Windows.Forms.Form.ShowDialog()
at Project_Starter.frmOrders.btnClose_Click(Object sender, EventArgs e) in F:'MIS 304'Homework'Project Starter'Project Starter'Project Starter'frmOrders.vb:line 70
at System.Windows.Forms.Control.OnClick(EventArgs e)
有没有人知道是什么原因导致这个错误,我怎么能解决这个问题?
"已经可见的窗体不能显示为模态对话框"
已经说了。似乎你正试图显示实际形式(按钮放置)或另一种现有形式作为模态形式。你不能。