定义了一个控件<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class UserControl1 Inherits System.Windows.Forms.UserControl 'UserControl 重写 Dispose,以清理组件列表。 <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then components.Dispose() End If Finally MyBase.Dispose(disposing) End Try End Sub 'Windows 窗体设计器所必需的 Private components As System.ComponentModel.IContainer '注意: 以下过程是 Windows 窗体设计器所必需的 '可以使用 Windows 窗体设计器修改它。 '不要使用代码编辑器修改它。 <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent() components = New System.ComponentModel.Container() Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font MessageBox.Show("显示消息框") End SubEnd Class为什么把这个空间拖入一个form后会显示在InitializeComponent()方法中的message呢,这不说明已经实例化了么,请教
这之前并没有实例化,只是定义了
Partial Class UserControl1
Inherits System.Windows.Forms.UserControl 'UserControl 重写 Dispose,以清理组件列表。
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub 'Windows 窗体设计器所必需的
Private components As System.ComponentModel.IContainer '注意: 以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器修改它。
'不要使用代码编辑器修改它。
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
components = New System.ComponentModel.Container()
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font MessageBox.Show("显示消息框")
End SubEnd Class为什么把这个空间拖入一个form后会显示在InitializeComponent()方法中的message呢,这不说明已经实例化了么,请教
脑子有点乱