473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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

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
Jul 21 '05 #1
2 2556
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/We...bjectConverter

Let me know if I could be of more help.

HTH,
Rakesh Rajan

"iainscott" wrote:
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

Jul 21 '05 #2
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(DesignerSerializationVisibi lity.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.
"Rakesh Rajan" wrote:
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/We...bjectConverter

Let me know if I could be of more help.

HTH,
Rakesh Rajan

"iainscott" wrote:
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

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: SammyBar | last post by:
Hi, I'm trying to bind a custom collection class to a data grid, following the guidelines from the article http://msdn.microsoft.com/msdnmag/issues/05/08/CollectionsandDataBinding/default.aspx....
1
by: malcolm | last post by:
Hello, We use several user controls and derived custom controls. Some of which actually hit the database at design time to show data (such as filling a list box, etc...) Our c# client server...
0
by: Andrew Baker | last post by:
I have a progress bar which is nested control and I want to persist the design time properties of this nested control. I thought all I needed to do was mark it with the...
2
by: WebWacker | last post by:
Hi, I'm trying to write a Control (inherited from Control) which contains four panels. These panels are created in the constructor, and are read-only. The individual properties of the panels...
1
by: Peter | last post by:
How do I create a button class that has an image(not background image) mapped to it at design time. IE. Button size 30x30 and Pic1 30x30 jpg when I drop the control on the form the image is...
2
by: iainscott | last post by:
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...
0
by: fiaolle | last post by:
Hi I have a combobox wich I set the Datasource,Displaymember and Valuemember at design time. I'm using a Dataset's table. But when I run the form the combobox isn't filled. Can't I set properties...
0
by: vml | last post by:
Hello, Does anybody know how to modify the property of a design-time activeX property ? using win32com thank you for your help,
4
by: Ken Fine | last post by:
I've been living with a frustrating issue with VS.NET for some months now and I need to figure out what the problem is. Hopefully someone has run into the same issue and can suggest a fix. I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.