VS.Net Property Collection Editor

F

Friskusen

I have (almost) added a simple Toolbar custom control to my control library.

The Items on the toolbar are implemented in a class named ToolbarItem.
I also use a class ToolbarItemCollection to manage ToolbarItems.
The Toolbar control has a property

Public ReadOnly Property Items() as ToolbarItemCollection

This setup is very similar to the standard ListView control which uses a
ColumnHeaderCollection to manage ColumnHeaders.

When clicking the Items property in VS property window i get the
property collection editor with all the ToolbarItem properties, but when
i close the property editor and look inside the source, the Items property
is
just set to Nothing.

I would like VS to initialize the ToolbarItems and add them to the
ToolbarItemCollection, that is:

(Dim ToolbarItem1 as new ToolbarItem....
Toolbar1.Items.AddRange(ToolbarItem1,......)

Anybody ?

Regard, Anders











To add an item manually, i would simply write:

dim ToolbarItem1 as new ToolbarItem
..
..
Toolbar.Items.AddRange(ToolbarItem1,...etc)
..

What i really wish is to add Items at design time in using VS.Net property
collection editor.
 
K

Ken Tucker [MVP]

Hi,

Take a look at the vbPowerPack's utility toolbar control. You can
download the source and see how to create a property editor.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbpowerpack.asp

Ken
----------------------------
I have (almost) added a simple Toolbar custom control to my control library.

The Items on the toolbar are implemented in a class named ToolbarItem.
I also use a class ToolbarItemCollection to manage ToolbarItems.
The Toolbar control has a property

Public ReadOnly Property Items() as ToolbarItemCollection

This setup is very similar to the standard ListView control which uses a
ColumnHeaderCollection to manage ColumnHeaders.

When clicking the Items property in VS property window i get the
property collection editor with all the ToolbarItem properties, but when
i close the property editor and look inside the source, the Items property
is
just set to Nothing.

I would like VS to initialize the ToolbarItems and add them to the
ToolbarItemCollection, that is:

(Dim ToolbarItem1 as new ToolbarItem....
Toolbar1.Items.AddRange(ToolbarItem1,......)

Anybody ?

Regard, Anders











To add an item manually, i would simply write:

dim ToolbarItem1 as new ToolbarItem
..
..
Toolbar.Items.AddRange(ToolbarItem1,...etc)
..

What i really wish is to add Items at design time in using VS.Net property
collection editor.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top