G
Guest
Is there any easy way to derive Form class from another Form class, rather then derive it from System.Windows.Form directly? My problem is that Visual Studio designer wouldn't render the form if you derive it from another form which is an abstract class
The "half way" solution I found is to use conditional compilation approach like this
public class MyForm :
#if NETCFDESIGNTIM
System.Windows.Forms.For
#els
MyBaseFor
#endi
.........
#if !NETCFDESIGNTIME
override
#endif public void InitializeComponent(
#if !NETCFDESIGNTIME
base. InitializeComponent()
#endi
......
#if NETCFDESIGNTIM
public class MyBaseForm: System.Windows.Forms.Form
#els
public abstract class MyBaseForm: System.Windows.Forms.Form #endi
#if ! NETCFDESIGNTIM
virtual
#endi
public void InitializeComponent(
........
This is working OK, but I have to manually define and undefine NETCFDESIGNTIME in order to switch between designer and runtime builds. I have seen an article on how to build two versions of the assembly to keep designer happy. One for Design mode and one for .Net CF runtime. I think I should use System.CF.Design.RuntimeAssembly attribute. I just don't know what would be the best way to do it
Any suggestions would be greatly appreciated
Thanks
Pave
The "half way" solution I found is to use conditional compilation approach like this
public class MyForm :
#if NETCFDESIGNTIM
System.Windows.Forms.For
#els
MyBaseFor
#endi
.........
#if !NETCFDESIGNTIME
override
#endif public void InitializeComponent(
#if !NETCFDESIGNTIME
base. InitializeComponent()
#endi
......
#if NETCFDESIGNTIM
public class MyBaseForm: System.Windows.Forms.Form
#els
public abstract class MyBaseForm: System.Windows.Forms.Form #endi
#if ! NETCFDESIGNTIM
virtual
#endi
public void InitializeComponent(
........
This is working OK, but I have to manually define and undefine NETCFDESIGNTIME in order to switch between designer and runtime builds. I have seen an article on how to build two versions of the assembly to keep designer happy. One for Design mode and one for .Net CF runtime. I think I should use System.CF.Design.RuntimeAssembly attribute. I just don't know what would be the best way to do it
Any suggestions would be greatly appreciated
Thanks
Pave