User Defined Property Pages/Task

JaedenRuiner

Well-known member
Joined
Aug 13, 2007
Messages
340
Programming Experience
10+
Alright,

So I've created a UserControl that basically is designed to allow me to add as many panels as I want to it, with the ability to cycle through the Panels or select them as necessary.

So I have two main properties that I believe should be accessible through the Property Grid but I'm not precisely sure how I would do that.

I've looked into the EditorAttribute() attribute for properties and such, but I'm still a little confused.

Basically, the two properties i want to create editors for are:
  • Pages()
    • SelectedPage
    • SelectedIndex

Now SelectedPage (and SelectedIndex is the Index of that Page) and basically acts the same as the parallel properties of the TabControl, but in my case it cycles through setting the visible property to false for all non-selected Panels and the selected panel's visible property to true)

My Plan was to have that as a ComboBox in the propertygrid allowing me to choose from all added Panels in the control while in design view, so that even in design view only one panel is visible at a time.

Secondly, the Pages() collection returns a PageCollection, which inherits from the ControlCollection() and replaces the default control collection in the CreateControlsInstance(). That I want to open my "Panel" editor form, which looks much like the TabPages editor for the TabControl.

The Question is how. I can design all the elements, but how do I link the added pages in the Designer form to actual added pages in the control, adding them as Panel1 etc to the .Designer.vb of my form, but then declaring them as Children of the MultiPageCtrl usercontrol I've created.
Also I'd like to have "AddPage" "RemovePage" in the small tasks window that is on the designer form (usually popping up when you click the little arrow)

This is probably a lot of stuff to explain all at once, so a good tutorial would be awesome, as well I can provide the source for this if that would be helpful.

Thanks
 
Back
Top