Form template for use with visual inheritance : Form Inheritance « GUI « VB.Net






Form template for use with visual inheritance

Form template for use with visual inheritance
Imports System
Imports System.Drawing
Imports System.Windows.Forms


Public Class MainClass

   Shared Sub Main()
        Dim myform As Form = New FrmInheritance()
        Application.Run(myform)

   End Sub ' Main

End Class


Public Class FrmInheritance
   Inherits Form

#Region " Windows Form Designer generated code "

   Public Sub New()
      MyBase.New()

      'This call is required by the Windows Form Designer.
      InitializeComponent()

      'Add any initialization after the InitializeComponent() call

   End Sub

   'Form overrides dispose to clean up the component list.
   Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
      If disposing Then
         If Not (components Is Nothing) Then
            components.Dispose()
         End If
      End If
      MyBase.Dispose(disposing)
   End Sub
   Friend WithEvents lblBug As System.Windows.Forms.Label
   Friend WithEvents lblCopyright As System.Windows.Forms.Label
   Friend WithEvents cmdLearn As System.Windows.Forms.Button

   'Required by the Windows Form Designer
   Private components As System.ComponentModel.Container

   'NOTE: The following procedure is required by the Windows Form Designer
   'It can be modified using the Windows Form Designer.  
   'Do not modify it using the code editor.
   <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
      Me.lblCopyright = New System.Windows.Forms.Label()
      Me.cmdLearn = New System.Windows.Forms.Button()
      Me.lblBug = New System.Windows.Forms.Label()
      Me.SuspendLayout()
      '
      'lblCopyright
      '
      Me.lblCopyright.BackColor = System.Drawing.Color.LightYellow
      Me.lblCopyright.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
      Me.lblCopyright.Font = New System.Drawing.Font("Microsoft Sans Serif", 11.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
      Me.lblCopyright.ForeColor = System.Drawing.Color.MidnightBlue
      Me.lblCopyright.Location = New System.Drawing.Point(20, 178)
      Me.lblCopyright.Name = "lblCopyright"
      Me.lblCopyright.Size = New System.Drawing.Size(318, 29)
      Me.lblCopyright.TabIndex = 1
      Me.lblCopyright.Text = "Copyright."
      '
      'cmdLearn
      '
      Me.cmdLearn.BackColor = System.Drawing.Color.Snow
      Me.cmdLearn.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
      Me.cmdLearn.ForeColor = System.Drawing.SystemColors.InfoText
      Me.cmdLearn.Location = New System.Drawing.Point(20, 99)
      Me.cmdLearn.Name = "cmdLearn"
      Me.cmdLearn.Size = New System.Drawing.Size(144, 59)
      Me.cmdLearn.TabIndex = 2
      Me.cmdLearn.Text = "Learn More"
      '
      'lblBug
      '
      Me.lblBug.BackColor = System.Drawing.Color.LightYellow
      Me.lblBug.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
      Me.lblBug.Font = New System.Drawing.Font("Microsoft Sans Serif", 20.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
      Me.lblBug.ForeColor = System.Drawing.Color.MidnightBlue
      Me.lblBug.Location = New System.Drawing.Point(20, 20)
      Me.lblBug.Name = "lblBug"
      Me.lblBug.Size = New System.Drawing.Size(318, 59)
      Me.lblBug.TabIndex = 0
      Me.lblBug.Text = "About"
      Me.lblBug.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
      '
      'FrmInheritance
      '
      Me.AutoScaleBaseSize = New System.Drawing.Size(6, 15)
      Me.BackColor = System.Drawing.SystemColors.ActiveBorder
      Me.ClientSize = New System.Drawing.Size(358, 223)
      Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.cmdLearn, Me.lblCopyright, Me.lblBug})
      Me.Name = "FrmInheritance"
      Me.Text = "Visual Inheritance"
      Me.ResumeLayout(False)

   End Sub

#End Region

   ' invoked when user presses Learn More button
   Private Sub cmdLearn_Click(ByVal sender As System.Object, _
      ByVal e As System.EventArgs) Handles cmdLearn.Click

      MessageBox.Show("www.java2s.com ", "Learn More", MessageBoxButtons.OK, _
         MessageBoxIcon.Information)
   End Sub ' cmdLearn_Click

End Class
           
       








Related examples in the same category

1.Frame Inherits from another Frame InheritanceFrame Inherits from another Frame Inheritance