Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Base Windows Form Class (newby)

Reply
Thread Tools

Base Windows Form Class (newby)

 
 
Fred Nelson
Guest
Posts: n/a
 
      02-10-2004
I'm working on a VB.NET application and I have heard that there are many
benefits to creating a base form class and using it. In my case I have
several user controls that I routinely put on each page and it would be
great to make changes to only one form and have them change all forms.

The problem is - I can't figure out how to create one and MSDN assumes that
you already know how!

Does anyone know where there is a tutorial on how to do this?

I would greatly appreciate it!

Thanks,

Fred


 
Reply With Quote
 
 
 
 
Gary Vidal
Guest
Posts: n/a
 
      02-10-2004
Home
You can only use single line of Inheritance although each class can
implement multiple interfaces
(Contract no implementation)
Public Class BaseForm : Inherits System.Windows.Forms.Form

'Your form base code in here

End Class

Public Class InheritedForm : Inherits MyNamespace.BaseForm

End Class

"Fred Nelson" <(E-Mail Removed)> wrote in message
news:utSYRc$(E-Mail Removed)...
> I'm working on a VB.NET application and I have heard that there are many
> benefits to creating a base form class and using it. In my case I have
> several user controls that I routinely put on each page and it would be
> great to make changes to only one form and have them change all forms.
>
> The problem is - I can't figure out how to create one and MSDN assumes

that
> you already know how!
>
> Does anyone know where there is a tutorial on how to do this?
>
> I would greatly appreciate it!
>
> Thanks,
>
> Fred
>
>



 
Reply With Quote
 
 
 
 
Fred Nelson
Guest
Posts: n/a
 
      02-10-2004
David:

I'm confused!?

I have several user controls that I put on my forms already.

A book that I'm reading says that you can create your own base form so that
you can inherit from it rather than placing the controls on each new form.
If you do this then you don't need to put your user controls on each form as
they are already there. Also I have some security code that I would like to
put in the base form so I don't run the chance of not including it on each
page.

Is there an alternative to putting all the user controls on each form?

Thanks again,

Fred




"David Coe, MCP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Fred -
>
> What you are looking to do is make a UserControl (.ascx) file that you can

drop on each page. This control acts like a traditional include file in
ASP, with full code behind support. When you make a change to the control
file, the changes will be displayed everywhere the control is placed.
>
> - David Coe, MCP



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Base class method Need base class value Karan Rajput Ruby 2 12-22-2010 04:47 PM
base class public type (non template and template base class) Hicham Mouline C++ 1 04-20-2009 03:28 PM
Access of base class' private base class: qualification required, why Alf P. Steinbach C++ 6 09-03-2005 04:03 PM
Virtual function 'BasicMidReader::~BasicMidReader()' conflicts with base class 'base 'TMemoryStream' tomek C++ 2 12-01-2003 06:31 AM
Virtual function 'BasicMidReader::~BasicMidReader()' conflicts with base class 'base 'TMemoryStream' tomek C++ 3 11-30-2003 12:18 AM



Advertisments