
Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
> You actually can make a form inherit from 'System.Windows.Forms.Form',
> that's what is actually done when adding a new form to the project.
But you can't put an intermediate inherited class in the way though. You can
on ASP.NET - we have our own MyApp.Page class which is ineffect the equiv.
of the form.
Cheers, Rob.
Herfried K. Wagner [MVP] - 05 Feb 2006 12:09 GMT
"Rob Nicholson" <rob.nicholson@nospam_unforgettable.com> schrieb:
>> You actually can make a form inherit from 'System.Windows.Forms.Form',
>> that's what is actually done when adding a new form to the project.
>
> But you can't put an intermediate inherited class in the way though. You
> can on ASP.NET - we have our own MyApp.Page class which is ineffect the
> equiv. of the form.
You can create a class which inherits from 'Form' and a second class which
inherits from your custom form class ("Project" -> "Add inherited form...").

Signature
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Rob Nicholson - 10 Feb 2006 01:19 GMT
> You can create a class which inherits from 'Form' and a second class which
> inherits from your custom form class ("Project" -> "Add inherited
> form...").
Ahh ha - that was the missing link. I was simply trying to create a base
class that was normal class, not a form which is then inherited. Works a
treat.
Thanks, Rob.
Bob Powell [MVP] - 05 Feb 2006 13:26 GMT
Take a look at the ideas of Visual Inheritance.

Signature
Bob Powell [MVP]
Visual C#, System.Drawing
Ramuseco Limited .NET consulting
http://www.ramuseco.com
Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
>> You actually can make a form inherit from 'System.Windows.Forms.Form',
>> that's what is actually done when adding a new form to the project.
[quoted text clipped - 4 lines]
>
> Cheers, Rob.
Bruce Wood - 06 Feb 2006 21:06 GMT
> > You actually can make a form inherit from 'System.Windows.Forms.Form',
> > that's what is actually done when adding a new form to the project.
[quoted text clipped - 4 lines]
>
> Cheers, Rob.
Is the "intermediate inherited class" abstract, by any chance?
Not sure what you mean. This works, I do it all the time:
ref class MyForm : public Form
{
MyForm() : Form() {}
} ;
even:
ref class MyDerivedForm : public MyForm
{
MyDerivedForm() : MyForm() {}
} ;
Note that 'Form' is 'System.Windows.Forms.Form', but I use 'using' to avoid
excessive typing... : )
[==P==]
> "Rob Nicholson" <rob.nicholson@nospam_unforgettable.com> schrieb:
>> The designer doesn't seem to like it but the question is why was it
>> designed like this?
>
> You actually can make a form inherit from 'System.Windows.Forms.Form',
> that's what is actually done when adding a new form to the project.