Is there documentation of what we should not change in the Initialize
Component of a Windows form?
For example, the following code was generated by VB .NET:
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(242, 223)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnGreeting,
Me.txtName, Me.lblInstruction})
Me.Menu = Me.OptionMenu
Me.Name = "frmHello"
Me.Text = "Hello"
Me.ResumeLayout(False)
I then changed the code to:
With Me
.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
.ClientSize = New System.Drawing.Size(242, 223)
.Controls.AddRange(New System.Windows.Forms.Control() _
{.btnGreeting, .txtName, .lblInstruction})
.Menu = .OptionMenu
.Name = "frmHello"
.Text = "Hello"
.ResumeLayout(False)
End With
This change caused the controls to vanish in designer view, but the code
still ran correctly.
Where can I find more info on what we can do with code in the Initialize
Component?