Hi,

I created a .NET CF custom control with a standard type (int) property and a
custom one (enum) like this:

public enum EnumTest
{
Value0,
Value1,
Value2
}

When

a./ I use an import method using [DllImport()] or
b./ I declare any other device-specific field (e.g. field from
Microsoft.WindowsCE.Forms.MessageWindow)

the enum property of my custom control class does not appear in the Visual
Studio property editor.
There is not necessary to use the imported method or anything from the
MessageWindow field.
In addition, there is no error/warning message about VS's problem.

Otherwise, the standard typed property (int) appears correctly in this case.

My questions are:
1. How can I make visible my custom typed (enum) property in the designer?
2. Enum is not a device-specific part of my control but the VS does not
display it. Why?

I would appreciate it if anybody would help me. Thanks!

Re: Enum property of custom control does not appear in VS2005/2008 by Arun

Arun
Thu Mar 06 18:46:19 CST 2008

Check this out,

http://blogs.msdn.com/bluecollar/archive/2007/02/08/adding-compact-framework=
-design-time-attributes-or-more-fun-with-textboxes.aspx

http://msdn2.microsoft.com/en-us/library/ms180789.aspx

http://msdn2.microsoft.com/en-us/library/aa446505.aspx

Hope this helps,
Cheers,
Arun

On Mar 6, 12:06=A0pm, LPeter <LPe...@discussions.microsoft.com> wrote:
> Hi,
>
> I created a .NET CF custom control with a standard type (int) property and=
a
> custom one (enum) like this:
>
> =A0 =A0 public enum EnumTest
> =A0 =A0 {
> =A0 =A0 =A0 =A0 Value0,
> =A0 =A0 =A0 =A0 Value1,
> =A0 =A0 =A0 =A0 Value2
> =A0 =A0 }
>
> When
>
> =A0 =A0a./ I use an import method using [DllImport()] or
> =A0 =A0b./ I declare any other device-specific field (e.g. field from
> Microsoft.WindowsCE.Forms.MessageWindow)
>
> the enum property of my custom control class does not appear in the Visual=

> Studio property editor.
> There is not necessary to use the imported method or anything from the
> MessageWindow field.
> In addition, there is no error/warning message about VS's problem.
>
> Otherwise, the standard typed property (int) appears correctly in this cas=
e.
>
> My questions are:
> 1. How can I make visible my custom typed (enum) property in the designer?=

> 2. Enum is not a device-specific part of my control but the VS does not
> display it. Why?
>
> I would appreciate it if anybody would help me. Thanks!


Re: Enum property of custom control does not appear in VS2005/2008 by LPeter

LPeter
Fri Mar 07 07:08:04 CST 2008



Dear Arun,

Thanks for suggestions, these were very useful.
Unfortunately, all articles of your links about VS2003 or VS2005.
I don't know what the differences are in VS2005 and VS2008, but things don't
work in my environment (XP Prof, VS2008).

1./ I can not find RunTimeAssembly attribute anywhere. Therefore, I didn't
write it to my source.
2./ I created the design-time assembly of my control-project and then I
added it to the Toolbox successfully. When I working with a form in my smart
device application project I can not find any custom controls of mine in
Toolbox window of VS2008.
3./ Only my run-time assemblies appear in Toolbox window (if I enable the
AutoToolboxPopulate option or if I add it manually).
4./ If I create a new full version .NET Windows Application project the
design-time (full .NET) version of custom controls appear in Toolbox window.
5./ By the way, the design time attributes in .cs files (using conditional
assemblies) doesn't seem to work. Attributes in the .xmta file work only
(this file is in my run-time assembly).

It would seem to working with custom controls in Compact Framework so clumsy
or I do something wrong (but what?).

My new-old questions are:
1./ What are the differences in VS2005 and VS2008 about the .NET Compact
Framework custom control handling? Is there any changing?
2./ Where can I find RuntimeAssembly attribute?
3./ Which attributes are necessary to display my custom control in VS2008
property editor at least (minimum requirements)?
4./ The standard typed properties (int, bool, string, etc.) are working
correctly. Enum is not a device-specific part of any control but the VS does
not display it. Why? How can I force the VS to display it?

LPeter


"Arun" wrote:

> Check this out,
>
> http://blogs.msdn.com/bluecollar/archive/2007/02/08/adding-compact-framework-design-time-attributes-or-more-fun-with-textboxes.aspx
>
> http://msdn2.microsoft.com/en-us/library/ms180789.aspx
>
> http://msdn2.microsoft.com/en-us/library/aa446505.aspx
>
> Hope this helps,
> Cheers,
> Arun
>
> On Mar 6, 12:06 pm, LPeter <LPe...@discussions.microsoft.com> wrote:
> > Hi,
> >
> > I created a .NET CF custom control with a standard type (int) property and a
> > custom one (enum) like this:
> >
> > public enum EnumTest
> > {
> > Value0,
> > Value1,
> > Value2
> > }
> >
> > When
> >
> > a./ I use an import method using [DllImport()] or
> > b./ I declare any other device-specific field (e.g. field from
> > Microsoft.WindowsCE.Forms.MessageWindow)
> >
> > the enum property of my custom control class does not appear in the Visual
> > Studio property editor.
> > There is not necessary to use the imported method or anything from the
> > MessageWindow field.
> > In addition, there is no error/warning message about VS's problem.
> >
> > Otherwise, the standard typed property (int) appears correctly in this case.
> >
> > My questions are:
> > 1. How can I make visible my custom typed (enum) property in the designer?
> > 2. Enum is not a device-specific part of my control but the VS does not
> > display it. Why?
> >
> > I would appreciate it if anybody would help me. Thanks!
>
>