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 / .NET Framework / General / October 2004

Tip: Looking for answers? Try searching our database.

Design time nested properties like Size, Location, Font, etc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
iainscott - 17 Oct 2004 21:09 GMT
Does anyone know how to make a multi-attribute property show in the design
time property window of VS IDE in the same way as .Net controls e.g. the Font
property has a + sign against it and can be expanded to reveal the child
proerties.

I am trying to implement a LineStyle property in a control derived form
UserControl which has child properties such as LineWidth, Colour, etc.  
Category attribute is not suitable because this only groups properties, it
does not nest them.

Can anyone point me in the right direction.

many thanks
Rakesh Rajan - 17 Oct 2004 23:41 GMT
Hi iainscott,

What you need is an ExpandableObjectConverter which encapsulates all this
functionality to make the property expandable.
Check out this article on the same topic
http://www.bluevisionsoftware.com/WebSite/TipsAndTricksDetails.aspx?Name=Expanda
bleObjectConverter


Let me know if I could be of more help.

HTH,
Rakesh Rajan

> Does anyone know how to make a multi-attribute property show in the design
> time property window of VS IDE in the same way as .Net controls e.g. the Font
[quoted text clipped - 9 lines]
>
> many thanks
iainscott - 30 Oct 2004 14:43 GMT
Thanks Rakesh, I think of I've got the haqng of it now.

I have come across another sticking point, however.  I have a pop up form
within my control which contains a list box which I wish to poulate both at
design-time and run time.  The pop up form is instantiated in the control's
constructor and persists for the lifetime of the parent control being either
hidden or shown as required.  When I expose the listbox items collection with
the following code the property appears in the design time property grid but
when I use the collections editor I cannot change any of the values.  I can
add new items to the list which persist between sessions but I still cannot
change the list item object.  Any suggestions?

private PopUpForm puf = null;

private System.ComponentModel.Container components = null;

    public MyControl()
    {
        // This call is required by the Windows.Forms Form Designer.
        InitializeComponent();

        puf = new PopUpForm();
    }

...

    [DesignerS    erializationVisibility(DesignerSerializationVisibility.Content)]
    public System.Windows.Forms.ListBox.ObjectCollection Items
    {
        get
        {
            return puf.ListBox.Items;
        }
    }

Hope someone can see where I'm being an idiot!

Best wishes.

> Hi iainscott,
>
[quoted text clipped - 21 lines]
> >
> > many thanks

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.