Use With statement to set Form properties : Introduction « GUI « VB.Net Tutorial






Use With statement to set Form properties
Imports System.Windows.Forms

public class FormWith
   public Shared Sub Main
    Dim Form2 As New Form()

    With Form2
      .Cursor = System.Windows.Forms.Cursors.Cross
      .Enabled = True
      .FormBorderStyle = FormBorderStyle.Sizable
      .Height = 400
      .HelpButton = True
      .MaximizeBox = True
      .MinimizeBox = True
      .Name = "Form2"
      .ShowInTaskbar = True
      .StartPosition = FormStartPosition.CenterParent
      .Text = "New Form"
      .Width = 500
      .WindowState = FormWindowState.Normal

      .ShowDialog()
    End With
   End Sub
End class








14.1.Introduction
14.1.1.Your first Form window
14.1.2.Create Form by inheriting System.Windows.Forms.FormCreate Form by inheriting System.Windows.Forms.Form
14.1.3.Add button to a formAdd button to a form
14.1.4.Control Dock: Top, BottomControl Dock: Top, Bottom
14.1.5.Button PerformClick MethodButton PerformClick Method
14.1.6.Use With statement to set Form propertiesUse With statement to set Form properties
14.1.7.Essential elements of a Windows Forms application.
14.1.8.Using Controls in a Windows Forms Application