Designing Forms not inheriting directly from System.Windows.Forms.Form

P

Patrick Long

I am currently working with Forms in the CompactFramework. The designer
cannot open Forms that inherit from anything other than
System.Windows.Forms.Form.

I would like to catch the opening of Forms in the designer and change their
base class from the custom one to System.Windows.Forms.Form.

Any ideas on how i could do this?

I thought about trying this

#if NETCFDESIGNTIME == true

public class ListControlTest : System.Windows.Forms.Form

#else

public class ListControlTest : Charteris.Mobile.PooledForm

#endif

but that does not work

Thanks
 
J

Joe Bork [MSFT]

Hello Patrick,

This is a limitation of the device Forms designer in VS.NET 2003. We don't
support designing inherited forms (that is, forms not deriving directly
from System.Windows.Forms.Form), as you've found. If you modify the form
to inherit from something other than Form, you'll wind up getting the
desktop forms designer (instead of the device forms designer) and you won't
be able to add any controls because the project references don't match.
There's no good workaround for this issue; you can create the form in code,
and not use the designer, or you could design the form using the desktop
forms designer (which would require you to fixup the desktop designer's
code spit by hand).

Neither of these are very good solutions, I know. We're hoping to have
much better support for designing these kinds of forms (those that don't
inherit directly from Form) in Whidbey, but unfortunately this isn't
supported currently.

--Joe



--------------------
| From: "Patrick Long" <patrick.long@nospamplease_btinternet.com>
| Subject: Designing Forms not inheriting directly from
System.Windows.Forms.Form
| Date: Wed, 22 Oct 2003 09:32:04 +0100
| Lines: 32
|
| I am currently working with Forms in the CompactFramework. The designer
| cannot open Forms that inherit from anything other than
| System.Windows.Forms.Form.
|
| I would like to catch the opening of Forms in the designer and change
their
| base class from the custom one to System.Windows.Forms.Form.
|
| Any ideas on how i could do this?
|
| I thought about trying this
|
| #if NETCFDESIGNTIME == true
|
| public class ListControlTest : System.Windows.Forms.Form
|
| #else
|
| public class ListControlTest : Charteris.Mobile.PooledForm
|
| #endif
|
| but that does not work
|
| Thanks
|
|
 

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