PC Review


Reply
Thread Tools Rate Thread

creating a base form class

 
 
Antuane
Guest
Posts: n/a
 
      25th Nov 2004
is it possible for me to create a base form class, & then some how configure
VB.NET,
so that when ever i create a new form, it will automatically be based on the
above form class.

i know i can go & manually inherit the above form, but i don't want to keep
doing this,
similarly with the textbox & command button controls.

??


 
Reply With Quote
 
 
 
 
Robby
Guest
Posts: n/a
 
      25th Nov 2004

Just make a new class that inherits from the base form instead of the
System.Windows.Forms.Form class. You get the user interface and can change
anything with public, friend or private scope. This includes the properties
and locations of the controls with scope access.

--Robby


"Antuane" <(E-Mail Removed)> wrote in message
news:u71%(E-Mail Removed)...
> is it possible for me to create a base form class, & then some how
> configure
> VB.NET,
> so that when ever i create a new form, it will automatically be based on
> the
> above form class.
>
> i know i can go & manually inherit the above form, but i don't want to
> keep
> doing this,
> similarly with the textbox & command button controls.
>
> ??
>
>



 
Reply With Quote
 
Antuane
Guest
Posts: n/a
 
      25th Nov 2004
Yes, but for this i'll have to specifically point the location or the base
class i want to use.
What i'd like to do is change the baseclass used in VB.net, so that it will
always use this new baseclass of mine (rather than me having to point out
this baseclass).

I want to override the base class of VB.net (or at least reconfigure it - if
overriding sounds to preposterous).


"Robby" <(E-Mail Removed)> wrote in message
news:eDcM#(E-Mail Removed)...
>
> Just make a new class that inherits from the base form instead of the
> System.Windows.Forms.Form class. You get the user interface and can

change
> anything with public, friend or private scope. This includes the

properties
> and locations of the controls with scope access.
>
> --Robby
>
>
> "Antuane" <(E-Mail Removed)> wrote in message
> news:u71%(E-Mail Removed)...
> > is it possible for me to create a base form class, & then some how
> > configure
> > VB.NET,
> > so that when ever i create a new form, it will automatically be based on
> > the
> > above form class.
> >
> > i know i can go & manually inherit the above form, but i don't want to
> > keep
> > doing this,
> > similarly with the textbox & command button controls.
> >
> > ??
> >
> >

>
>



 
Reply With Quote
 
Ken Tucker [MVP]
Guest
Posts: n/a
 
      25th Nov 2004
Hi,

Here is where the template is located by default. Maybe modify
it reflect your changes.

C:\Program Files\Microsoft Visual Studio .NET
2003\Vb7\VBWizards\WinForm\Templates\1033

Ken
--------------------------
"Antuane" <(E-Mail Removed)> wrote in message
news:u71%(E-Mail Removed)...
is it possible for me to create a base form class, & then some how configure
VB.NET,
so that when ever i create a new form, it will automatically be based on the
above form class.

i know i can go & manually inherit the above form, but i don't want to keep
doing this,
similarly with the textbox & command button controls.

??



 
Reply With Quote
 
Carlos J. Quintero [MVP]
Guest
Posts: n/a
 
      25th Nov 2004
You can create a custom form template. See this article of mine:

HOWTO: Changing the source code of templates used by Visual Studio .NET
wizards.
http://support.microsoft.com/default...b;en-us;555160

--

Carlos J. Quintero

The MZ-Tools all-in-one add-in, now for .NET: http://www.mztools.com


"Antuane" <(E-Mail Removed)> escribió en el mensaje
news:u71%(E-Mail Removed)...
> is it possible for me to create a base form class, & then some how
> configure
> VB.NET,
> so that when ever i create a new form, it will automatically be based on
> the
> above form class.
>
> i know i can go & manually inherit the above form, but i don't want to
> keep
> doing this,
> similarly with the textbox & command button controls.
>
> ??
>
>



 
Reply With Quote
 
Antuane
Guest
Posts: n/a
 
      27th Nov 2004
Thanx a lot guys, your replies have been much appreciated & of great value.
Thanx again.

"Antuane" <(E-Mail Removed)> wrote in message
news:u71#(E-Mail Removed)...
> is it possible for me to create a base form class, & then some how

configure
> VB.NET,
> so that when ever i create a new form, it will automatically be based on

the
> above form class.
>
> i know i can go & manually inherit the above form, but i don't want to

keep
> doing this,
> similarly with the textbox & command button controls.
>
> ??
>
>



 
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
Creating a Custom Enumerator in a Base Class Charles Law Microsoft Dot NET 1 19th Sep 2008 06:56 PM
Creating a Custom Enumerator in a Base Class Charles Law Microsoft VB .NET 1 19th Sep 2008 06:56 PM
how to make sure this.Test() call base class method in base class constructor Ryan Liu Microsoft C# .NET 2 27th Aug 2006 07:43 PM
Best practice for creating a user control base class in asp.net 2. =?Utf-8?B?YmFseXN0eWs=?= Microsoft ASP .NET 1 31st Dec 2005 09:16 PM
variable type that can be declared in a base class this is accessible only to classes that inherit the base class Dan Microsoft ASP .NET 1 24th Mar 2004 09:34 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:53 AM.