Imports System.Drawing
Imports System.Windows.Forms
Public Class WithForm : Inherits Form
Public Shared Sub Main()
Dim frm as New Form
With frm
.BackColor = Color.Gray
.ForeColor = Color.Red
.Text = "The With Statement"
Dim fnt As Font = .Font
MsgBox(fnt.Name)
.Enabled = True
.Topmost = True
.MinimizeBox = False
.ShowDialog()
End With
End Sub
End Class
|