Re: Abstract Form Class
From: Andrew Bingham (Andrew_at_AndrewBingham.com)
Date: 03/20/04
- Next message: Mike in Paradise: "RichTextBox AutoWordSelection-Does this Work???"
- Previous message: Dave Humphrey: "Control.DesignMode and OnPaint in Custom Control"
- In reply to: Siobhan: "Abstract Form Class"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 20 Mar 2004 16:20:58 -0000
Unless i misunderstood your question....
Visual inheritance is one of the key benefits of VB.NET.
A form can inherit from another form, and you can call the base form methods
and events (nybase.method) or override them in the subclassed forms, (or do
both of courses)
I have built an application that does exactly this.
-- **************************************************************************** andrewbingham.com tel 01223 514674 (Cambridge) mobile 07970 161057 fax 07970 601283 email Andrew@AndrewBingham.com DISCLAIMER, PLEASE NOTE: This communication is for the attention of the named recipient only The content should not be passed on to any other person. It is sent in good faith, in confidence, and without legal responsibility. VIRUS CHECK Emails and attachments are virus checked using Norton® AntiVirus® 2002 which is regularly updated. However it remains the recipients responsibility to check emails and attachments sent, or forwarded, from andrewbingham.com for viruses and macro viruses **************************************************************************** "Siobhan" <anonymous@discussions.microsoft.com> wrote in message news:10EBAE9A-D69A-4D3F-8659-CDB0CFAC98E0@microsoft.com... > Hi > I wonder can anyone answer - can I create a form which is an abstract class i.e. has the MustInherits keyword in the class definition > . > When I do this I get the error message: > > 'New' cannot be used on a class that is declared 'MustInherit'. > > This happens before I have put any other code on the system, all I have done is entered the MustInherits keyword - this is all the code in the form: > > Public MustInherit Class Form1 > Inherits System.Windows.Forms.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 > > '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. > <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent() > components = New System.ComponentModel.Container > Me.Text = "Form1" > End Sub > > #End Region > > End Class > > I have another form which has more properties and methods etc and I get a similary message: > 'New' cannot be used on class 'FormTemplates.frmStandardDataEntry' because it contains a 'MustOverride' member that has not been overridden. > > Any help is greatly appreciated! > Thanks > Siobhan >
- Next message: Mike in Paradise: "RichTextBox AutoWordSelection-Does this Work???"
- Previous message: Dave Humphrey: "Control.DesignMode and OnPaint in Custom Control"
- In reply to: Siobhan: "Abstract Form Class"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|