当我运行我的代码时,我遇到了第一次异常错误,我不知道为什么。我对 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)
有谁知道是什么导致了这个错误以及我该如何解决这个问题?