Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have created my own TabPage control, inheriting from the "standard" Windows.Forms.TabPage

 

However, I would like to be able to choose it at design time when creating a TabControl.

For exemple when we create a TableStyle at design time, the collection wizard offers us the possibility to choose between the TextBoxColumns and the BoolColumns

Is there a way to do the same in my case?

Is there any attribute that I have to use in that case ?

 

Thanks,

Jarod
Posted

Ok and I have seen that the TabPage (the standard one as my custom one) doesn't appear in the ToolBox when I try to customize it.

I think that this is normal as the TabPage can't be added in a container other than the TabControl.

But one other nice solution to my previous problem is to be able to Drag / Drop my custom TabPage in a TabControl (instead of adding "normal" TabPages end changing the generated code.

 

So is there a way to add a tabPage to the ToolBox ?

Thanks

Jarod
Posted

Tabpages like menu items are children classes to the main contorl TabContol and MainMenu\Context menu respectfuly

 

So no, just change the creation of you tabpages to your class instead of the normal tabpage class in the form geration code

 

so instead of

 

Friend WithEvents TabPage1 As System.Windows.Forms.TabPage
Me.TabPage1 = New System.Windows.Forms.TabPage()

 

it becomes

 

Friend WithEvents TabPage1 As UserTabPage
Me.TabPage1 = New UserTabPage()

 

remember UserTabPage is the class name of your inherited tabpage class.

 

Andy

Code today gone tomorrow!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...