基本用法:
With object
[statements]
End with
举例如下:
With Me.TextBox1
.Text = "Text with...end with"
.TextAlign = HorizontalAlignment.Center
.BorderStyle = BorderStyle.None
.AutoSize = True
End With
with... end with的嵌套
With Me.TextBox1
.Text = "Text with...end with"
.TextAlign = HorizontalAlignment.Center
.BorderStyle = BorderStyle.None
.ReadOnly = True
With Me
.StartPosition = FormStartPosition.CenterScreen
.MaximizeBox = False
.MinimizeBox = False
.Opacity = 50%
.FormBorderStyle = FormBorderStyle.FixedSingle
.ShowInTaskbar = False
End With
End With