-1

当我运行我的代码时,我遇到了第一次异常错误,我不知道为什么。我对 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)

有谁知道是什么导致了这个错误以及我该如何解决这个问题?

4

1 回答 1

0

“已经可见的表单无法显示为模态对话框”

这已经说明了。似乎您正在尝试将实际表单(放置按钮的位置)或另一个现有表单显示为模态表单。你不能。

于 2013-05-04T21:55:28.623 回答