Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / July 2004

Tip: Looking for answers? Try searching our database.

Sub Properties in Designer

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
msnews.microsoft.com - 29 Jul 2004 15:30 GMT
I have a class Order that contains a set of properties for my OrderControl
control.

Instead of creating separate properties in OrderControl for every property
in Order, I just wanted to make Order a property and then let the user set
any properites within Order via the designer.

But I don't get that plus mark. All I get is a string.

Was wondering ... how to I force the designer to get a plus mark so I can
edit those individual properties?
Eric Cadwell - 29 Jul 2004 16:28 GMT
Try adding the DesignerSerializationVisibility attribute to the Order
property:

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
public Order Order
{
   get { return order; }
}

HTH;
Eric Cadwell
http://www.origincontrols.com
Mick Doherty - 29 Jul 2004 17:14 GMT
I've just spent the whole day playing around with ExpandableObjectConverter,
so I know how frustrating it can be.
The ExpandableObject Class is simple enough to implement as is getting the
properties to serialize. The tricky part is getting the properties to
deserialize when you reset a property.

I won't go into it all here. If you take a look at my Office Style Menu Code
you should find the solution. Just look at the ItemColors property and
#Region " Expandable Object Convertor "
http://dotnetrix.co.uk/menus.html

You may also want to look at:
{http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/h
tml/vsnetpropbrow.asp?frame=true}

Signature

Mick Doherty
http://dotnetrix.co.uk/nothing.html

> I have a class Order that contains a set of properties for my OrderControl
> control.
[quoted text clipped - 7 lines]
> Was wondering ... how to I force the designer to get a plus mark so I can
> edit those individual properties?
msnews.microsoft.com - 30 Jul 2004 16:02 GMT
OK, thanks both of you for the posts. Here is where I am at. I really just
wanted to expose all the properties an object that I added to a control. The
simplest way to do that is ...

Add this to your property:

   [TypeConverter(typeof(IndicationTypeConverter))]

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
   public Indication Indication { ... }

Then create a class like this:

public class IndicationTypeConverter : ExpandableObjectConverter {}

That's it.

There is a whole world of ConvertFrom and ConvertTo ... that are great if
your object needs them, but for me, I just wanted to expose the properties,
and this did the job just fine!

> I have a class Order that contains a set of properties for my OrderControl
> control.
[quoted text clipped - 7 lines]
> Was wondering ... how to I force the designer to get a plus mark so I can
> edit those individual properties?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.