Visual Form Inheritance

G

Guest

Hi

Does anyone know if visual form inheritance is possible within Visual Studio using the .NET Compact Framework

For example, I have a base form that I would like to inherit from but when I try and do this the concrete class form will not display correctly within the designer. Something about the base class could not be found or intepreted. Has anyone come across this or has a valid work a round

Your help would be greatly appreciated.
 
F

Felipe T.

Yes, it is possible, but it appears to have some bugs.

Iv got the same problem here.
I have a base form, that implements some events for button pressing and some
default methods.
I inherits this form sometimes, and every time it gives me that problem.
Anyway, it compiles perfectly.
The pitty is that i cant see it in design-time, so i change inheritance to
basic form
when i want to change the design.
Then i change again to my base form when i want to compile, to implement
its full funcionality.

Its odd...


RJ said:
Hi,

Does anyone know if visual form inheritance is possible within Visual
Studio using the .NET Compact Framework.
For example, I have a base form that I would like to inherit from but when
I try and do this the concrete class form will not display correctly within
the designer. Something about the base class could not be found or
intepreted. Has anyone come across this or has a valid work a round.
 
C

Chris Tacke, eMVP

Visual inheritance is not supported in Smart Device apps.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


RJ said:
Hi,

Does anyone know if visual form inheritance is possible within Visual
Studio using the .NET Compact Framework.
For example, I have a base form that I would like to inherit from but when
I try and do this the concrete class form will not display correctly within
the designer. Something about the base class could not be found or
intepreted. Has anyone come across this or has a valid work a round.
 
E

Elisa

Hi,

The Form Designer only understands how to handle classes directly
inherited from System.Windows.Form when using Smart Device apps.


Regards,

Elisa
P.s. Hey Microsoft, if us Smart Device developers only get 1% of the
functionality, why do we have to pay a 100% for the VS .NET software?
 
G

Ginny Caughey [MVP]

Elisa,

Consider the rest of VS.Net as free. ;-) Seriously, I bet there's nobody who
uses 100% of all the goodies in VS.Net, but it's a good value for anybody if
it does the job they need, whatever that might be.
 
G

Guest

Hi Everyone

So to summarise everyone's input so far as I understand it. Visual inheritance is not supported but it is possible to do it as there is a workaround

I think I will find it slightly annoying that I will not be able to ammend the basic form in design time but the actual trade off for inheritance is far greater to achieve re-usable code. Does everyone agree

Thanks for all your input. I am just trying to architect and design a well formed application which will get around some of these technical issues

RJ
 
M

Maarten Struys, eMVP

Although Visual Form Inheritance is not supported, here is a little article
showing you what you can do as a work-around:
http://www.dotnetfordevices.com/articles/26.html

--
Regards,

Maarten Struys, eMVP
PTS Software bv

www.dotnetfordevices.com | www.opennetcf.org

RJ said:
Hi Everyone,

So to summarise everyone's input so far as I understand it. Visual
inheritance is not supported but it is possible to do it as there is a
workaround.
I think I will find it slightly annoying that I will not be able to ammend
the basic form in design time but the actual trade off for inheritance is
far greater to achieve re-usable code. Does everyone agree?
Thanks for all your input. I am just trying to architect and design a well
formed application which will get around some of these technical issues.
 
J

Jon Pawley

Hi Maarten,

That link to the article was very helpful, thanks for that.

I don't suppose you, or anyone else, knows whether there is a special
"hidden" symbol that is defined when the Forms Designer is running the
code? This would allow the conditional compilation to be a bit
smarter, and not have to rely on the user (me!) remembering to
add/delete the appropriate definition.

I think I might be hoping for a little too much though...

Cheers,

Jon
 
M

Maarten Struys, eMVP

Hmm, I tried to post this earlier today from the Web-based newsreader, but I
don't see my original post, so here it is again.

There are no "hidden" symbols that I know of. However, what you could do is
make use of a feature of VS.NET, creating a new configuration, specifically
for designer_mode. What you would do is the following:
Create a new configuration using Build - Configuration Manager. In the
configuration manager dialog box create a new configuration (e.g.
designer_mode), based on the already existing Debug configuration. When you
open your project you now select designer_mode when you are designing your
(inherited) forms. Make sure to right click the project file in the solution
explorer, select properties and add a compiler constant for the
designer_mode configuration (in configuration properties - build). For
instance you now can add DESIGNER_SUPPORT. Once you want to build a debug or
release version, just change the configuration accordingly, meaning
DESIGNER_SUPPORT is no longer defined. In this case you don't have to change
the source code, as I suggested in the article.

Thanks for inspiring me to think a little further. I will change the article
(http://www.dotnetfordevices.com/articles/26.html) as soon as possible
accordingly.

--
Regards,

Maarten Struys, eMVP
PTS Software bv

www.opennetcf.org | www.dotnetfordevices.com
 
J

Jon Pawley

Hi Maarten,

Thanks for the follow up.

I came to a _remarkably_ similar solution having let things mull over
for a day or so, and it works really well for me. Hope other people
fnd it useful too.

Cheers,

Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top