The designer doesn't seem to like it but the question is why was it designed
like this?

Cheers, Rob.

PS. And can you do it in VS 2005?

Re: Why can't you inherit System.Windows.Forms.Form? by Herfried

Herfried
Sat Feb 04 07:34:19 CST 2006

"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.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Re: Why can't you inherit System.Windows.Forms.Form? by Rob

Rob
Sun Feb 05 05:54:08 CST 2006

> 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.



Re: Why can't you inherit System.Windows.Forms.Form? by Herfried

Herfried
Sun Feb 05 06:09:21 CST 2006

"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...").

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Re: Why can't you inherit System.Windows.Forms.Form? by Bob

Bob
Sun Feb 05 07:26:43 CST 2006

Take a look at the ideas of Visual Inheritance.

--
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.





"Rob Nicholson" <rob.nicholson@nospam_unforgettable.com> wrote in message
news:%23ovSfrkKGHA.3732@TK2MSFTNGP10.phx.gbl...
>> 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.
>



Re: Why can't you inherit System.Windows.Forms.Form? by Patrice

Patrice
Mon Feb 06 07:01:03 CST 2006

What is the behavior you see ? This is what the designer always do when you
create a form ! Should work.

--
Patrice

"Rob Nicholson" <rob.nicholson@nospam_unforgettable.com> a écrit dans le
message de news:%23QjQHaYKGHA.648@TK2MSFTNGP14.phx.gbl...
> The designer doesn't seem to like it but the question is why was it
designed
> like this?
>
> Cheers, Rob.
>
> PS. And can you do it in VS 2005?
>
>



Re: Why can't you inherit System.Windows.Forms.Form? by Bruce

Bruce
Mon Feb 06 15:06:04 CST 2006


Rob Nicholson wrote:
> > 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.

Is the "intermediate inherited class" abstract, by any chance?


Re: Why can't you inherit System.Windows.Forms.Form? by Peter

Peter
Tue Feb 07 12:11:16 CST 2006

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==]

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:uwwLr%23YKGHA.4044@TK2MSFTNGP10.phx.gbl...
> "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.
>
> --
> M S Herfried K. Wagner
> M V P <URL:http://dotnet.mvps.org/>
> V B <URL:http://classicvb.org/petition/>



Re: Why can't you inherit System.Windows.Forms.Form? by Rob

Rob
Thu Feb 09 19:19:25 CST 2006

> 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.