首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

namespace and new解决思路

2012-02-20 
namespace and newNamespaceabcPublicClassForm1InheritsSystem.Windows.Forms.FormPublicSubNew()form1M

namespace and new
Namespace   abc
        Public   Class   Form1
                Inherits   System.Windows.Forms.Form
                Public   Sub   New()
                        form1   =   Me
                        InitializeComponent()
                        Me.Label1.Text   =   "试验 "
                End   Sub
                Friend   WithEvents   form1   As   System.Windows.Forms.Form
                Friend   WithEvents   Label1   As   System.Windows.Forms.Label

                Private   Sub   InitializeComponent()
                        Me.Label1   =   New   System.Windows.Forms.Label
                        Me.SuspendLayout()
                        '
                        'Label1
                        '
                        Me.Label1.AutoSize   =   True
                        Me.Label1.Location   =   New   System.Drawing.Point(110,   72)
                        Me.Label1.Name   =   "Label1 "
                        Me.Label1.Size   =   New   System.Drawing.Size(41,   12)
                        Me.Label1.TabIndex   =   0
                        Me.Label1.Text   =   "Label1 "
                        '
                        'Form1
                        '
                        Me.AutoScaleDimensions   =   New   System.Drawing.SizeF(6.0!,   12.0!)
                        Me.AutoScaleMode   =   System.Windows.Forms.AutoScaleMode.Font
                        Me.ClientSize   =   New   System.Drawing.Size(292,   267)
                        Me.Controls.Add(Me.TextBox1)
                        Me.Controls.Add(Me.Label1)
                        Me.Name   =   "Form1 "


                        Me.Text   =   "Form1 "
                        Me.ResumeLayout(False)
                        Me.PerformLayout()

                End   Sub

        End   Class
End   Namespace
这样没错吧,为什么,我在别的地方,引入了该命名空间后,调用form1的new,标签的text不会显示呢,是不是没有执行new这段代码?
把namespace去掉后,就可以,请问为什么?

[解决办法]
不会吧!

热点排行