Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Power of Visual Inheritance in .NET – “Best”

, 4 Dec 2003
This article helps in exploring the power of Visual Inheritance and makes your application development very easy.

Public Class CForm2
    Inherits FormsInheritance.PMainForm

#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

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

    '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.
    Friend WithEvents Label1 As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.Label1 = New System.Windows.Forms.Label()
        Me.NavPanel.SuspendLayout()
        Me.SuspendLayout()
        '
        'BParent
        '
        Me.BParent.BackColor = System.Drawing.Color.Green
        Me.BParent.Visible = True
        '
        'NavPanel
        '
        Me.NavPanel.BackColor = System.Drawing.Color.Green
        Me.NavPanel.Dock = System.Windows.Forms.DockStyle.Bottom
        Me.NavPanel.Location = New System.Drawing.Point(0, 186)
        Me.NavPanel.Visible = True
        '
        'Label1
        '
        Me.Label1.BackColor = System.Drawing.Color.Brown
        Me.Label1.Font = New System.Drawing.Font("Tahoma", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.ForeColor = System.Drawing.Color.White
        Me.Label1.Location = New System.Drawing.Point(32, 40)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(216, 56)
        Me.Label1.TabIndex = 2
        Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'CForm2
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
        Me.ClientSize = New System.Drawing.Size(292, 266)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.NavPanel, Me.Label1})
        Me.Name = "CForm2"
        Me.Text = "Child Form 2"
        Me.NavPanel.ResumeLayout(False)
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub CForm2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.InfoLabel = Label1
        Me.Position = 28
    End Sub
End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Saurabhdotnet
Web Developer
India India
Saurabh Verma works as an Architect, possessing over 10 years designing and developing software and currently assists product companies to scale and writing flexible software. He has vast experience in designing Web 2.0 solutions using Microsoft Technologies; WF, WCF and AJAX.ASP.NET, and practicing AGILE Methodologies and Domain Driven Design for the implementation. He likes to perform superbike stunts in his free time. Smile | :)
 
He has been awarded Microsoft Most Valuable Professional, MCSD.NET, MCAD.NET, MCDBA and Microsoft Web Rock Star 2007.
 
He maintains his blog at http://www.domaindrivendesign.info for all the aspiring architects and developers.
 
You can reach him at saurabhdotnet@hotmail.com

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 5 Dec 2003
Article Copyright 2003 by Saurabhdotnet
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid