作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我无法弄清楚这里的问题是什么。我从头开始项目,去调试,并收到错误:
System.InvalidOperationException was unhandled Message=An error occurred creating the form. See Exception.InnerException for details. The error is: Object reference not set to an instance of an object.
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.269
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Namespace My
'NOTE: This file is auto-generated; do not modify it directly. To make changes,
' or if you encounter build errors in this file, go to the Project Designer
' (go to Project Properties or double-click the My Project node in
' Solution Explorer), and make changes on the Application tab.
'
Partial Friend Class MyApplication
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
End Sub
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Protected Overrides Sub OnCreateMainForm()
Me.MainForm = Global.AccountAndClientFull.frmMain 'HERE IS WHERE THE ERROR OCCURS
End Sub
End Class
End Namespace
Me.MainForm = Global.AccountAndClientFull.frmMain
最佳答案
我得到了同样的错误,并意识到这是因为我在表单代码中声明了一个私有(private)默认构造函数。如果您创建了一个构造函数并且没有将其公开,请尝试将其公开。
关于vb.net-2010 - OnCreateMainForm() Sub 内部 Application.Designer.vb 内部错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11887232/
假设在 WindowsFormsApplicationBase.OnCreateMainForm() 时出了点问题,如何“温和”退出应用程序?我想退出,就像使用时按下了关闭按钮一样,所以我猜 Envi
我无法弄清楚这里的问题是什么。我从头开始项目,去调试,并收到错误: System.InvalidOperationException was unhandled Message=An error oc
我是一名优秀的程序员,十分优秀!