all groups > dotnet windows forms designtime > march 2005 >
You're in the

dotnet windows forms designtime

group:

Nested Complex Properties Designer Problem


Nested Complex Properties Designer Problem ?eljko Margeta via .NET 247
3/7/2005 11:01:40 AM
dotnet windows forms designtime: Hi,

I am having a realy annoying problem=2E I'm creating a custom=
control, which uses a complex property named GradientColor=2E=
GradientColor class is consisted of an (int) Angle, (AlphaColor)=
BeginColor and (AlphaColor) EndColor=2E
On the other hand, AlphaColor is another class that consists of=
an (int) Alpha and (System=2EDrawing=2EColor) Color=2E I use the=
AlphaColor class instead of an System=2EDrawing=2EColor structure so=
that the user could edit the System=2EDrawing=2EColor=2EA (Alpha)=
value using a custom UITypeEditor=2E

My problem is the following=2E When I change the values of the=
GradientColor property in the designer, the nested BeginColor=
and EndColor properties (which are also expanded) do not=
"refresh" properly=2E The designer's PropertyGrid shows two (?!)=
EndColor properties, an a BeginColor property=2E It looks as the=
designer did not "update" itself properly=2E When I re-expand the=
parent or the nested properties, everything looks the way it=
should=2E

I am overriding the GetCreateInstanceSupported and CreateInstance=
methods=2E The other thing is that when I expose an AlphaColor=
property directly from the control (not nested under=
GradientColor), it interacts with the designer normaly=2E

--------------------------------
From: ?eljko Margeta

-----------------------
Posted by a user from =2ENET 247 (http://www=2Edotnet247=2Ecom/)

RE: Nested Complex Properties Designer Problem AviD
3/8/2005 8:41:03 AM
Hi
you need not work so hard. I've all the code that you need. Just go to my
site and download the source code of adxSuperPanel. You find a complete
Gradient class with all the properties that you need.
Http://www.gzdsoftware.com
Avi

[quoted text, click to view]
Re: Nested Complex Properties Designer Problem joeycalisay
3/9/2005 6:16:14 PM
how are you modifying the said properties? you need to broadcast each
change with the designer (raising componentchanging and componentchanged
properly) and this is done automatically if you changed this properties
using the typedescriptor.getproperties method, getting the
propertydescriptor using the propertyname and using the setvalue method. i
don't know the correct syntax but similar to this:

typedescriptor.getproperties(component)["myproperty"].setvalue(component,
newvalue as object)

--
Joey Calisay
http://spaces.msn.com/members/joeycalisay/


[quoted text, click to view]
Hi,

I am having a realy annoying problem. I'm creating a custom control, which
uses a complex property named GradientColor. GradientColor class is
consisted of an (int) Angle, (AlphaColor) BeginColor and (AlphaColor)
EndColor.
On the other hand, AlphaColor is another class that consists of an (int)
Alpha and (System.Drawing.Color) Color. I use the AlphaColor class instead
of an System.Drawing.Color structure so that the user could edit the
System.Drawing.Color.A (Alpha) value using a custom UITypeEditor.

My problem is the following. When I change the values of the GradientColor
property in the designer, the nested BeginColor and EndColor properties
(which are also expanded) do not "refresh" properly. The designer's
PropertyGrid shows two (?!) EndColor properties, an a BeginColor property.
It looks as the designer did not "update" itself properly. When I re-expand
the parent or the nested properties, everything looks the way it should.

I am overriding the GetCreateInstanceSupported and CreateInstance methods.
The other thing is that when I expose an AlphaColor property directly from
the control (not nested under GradientColor), it interacts with the designer
normaly.

--------------------------------
From: ?eljko Margeta

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>YdrIdd9iQ0+UYMcRuEpgrQ==</Id>

AddThis Social Bookmark Button