• 0

[VB.Net] Creating my own Tab-like control


Question

Hello there, fellow neowinians who have helped me dealing with my great ignorance! ;)

I am trying to create my own control that will be alot like the control

Outlook 2003 has where you can choose "mail", "Calendar", etc.

However, I've got two questions.

1) If you add a tab control, you can choose which tab you want to add

controls to in the development environment. How can I add this functionality

to my own control?

2) Each tab page has its own panel, and you can add controls to it at design

time. How can I archieve this with my own control?

Thank you for your time!

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

1. JUst use a simple integer property called "SelectedTabIndex" or something that enables/disables and shows/hides the various tabs in your control.

2. Apply a "Designer" attribute to your control's class that specifies "ParentControlDesigner" as the type of designer for your control. This is how you'd do it in C# (not sure about VB.Net):

[
  Designer(typeof(System.Windows.Forms.Design.ParentControlDesigner))
]
public class MyUserControl: System.Windows.Forms.UserControl
{
...
}

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.