PC Review


Reply
Thread Tools Rate Thread

Form Inheritance

 
 
HJ Rodirguez
Guest
Posts: n/a
 
      29th Jan 2004
Hello All,

I have created a base form (frmMDIChild) from which I would like to
inherit all future forms from.

The base form has 3 properties which I would like to enforce on all
forms which inherit from the base form.

Me.Icon = CType(resources.GetObject("$this.Icon"),
System.Drawing.Icon)
Me.MinimizeBox = False
Me.ShowInTaskbar = False

I would like to make so that the forms which inherit from my base form
can not change these properties.

Thanks in advance for your help.

HJ


Below is the code for my base class
-----------------------------------------------------------------------------
Public MustInherit Class frmMDIChild
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()
Dim resources As System.Resources.ResourceManager = New
System.Resources.ResourceManager(GetType(frmMDIChild))
'
'frmMDIChild
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(384, 302)
Me.Icon = CType(resources.GetObject("$this.Icon"),
System.Drawing.Icon)
Me.MinimizeBox = False
Me.ShowInTaskbar = False
Me.Name = "frmMDIChild"
Me.Text = "frmMDIChild"

End Sub

#End Region

End Class
-----------------------------------------------------------------------------
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form Inheritance: Specified Cast Is Not Valid? James Microsoft Dot NET Framework 5 20th Sep 2004 09:04 PM
Form Inheritance still a problem in VS 2003? Mike Microsoft Dot NET Framework 4 4th May 2004 02:33 AM
Need help with windows form inheritance Nathon Dalton Microsoft ASP .NET 1 17th Oct 2003 10:29 PM
Form Inheritance and Anchor mike Microsoft Dot NET Framework 0 26th Jul 2003 12:01 AM
visual inheritance of web form varun Microsoft ASP .NET 5 7th Jul 2003 12:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:24 AM.