Add Items metroTabControl

9.1k Views Asked by At

Can anyone tell me how to add items/controls to a metroTabControl (windows forms)? Whenever I try to do so with visual studio 2013 designer, it throws this error:

Cannot add 'MetroLabel' to TabControl. Only TabPages can be directly added to TabControls

4

There are 4 best solutions below

1
Hans Passant On BEST ANSWER

The .NET TabControl has a pretty fancy designer, they did not provide a very good substitute for it. Understandably, creating designers is a lot of work and designer code is quite obscure.

Select the MetroTabControl you added, note the little black triangle that's displayed on the upper-right. Click it and select Add Tab. You can now drop the label on the added tab page.

1
Steve Lillis On

As explicitly stated by the error you're experiencing, a TabControl only accepts TabPages.

Add a TabPage to the TabControl, then add a MetroLabel to that TabPage.

0
Odin On

Click on the TabPage you wish to add MetroLabel or any item to and then double click on MetroLabel or the item, it will add. Do not click and drag for that affect the TabControl and not the TabPage.

Enjoy coding

0
John On

Little Late but you can always place the controls somewhere on the underlying form and cut/paste them on the tab you want after you have moved the focus to it...