I know SOMEONE knows the answer to this...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Ok....

1. Take a windows form.
2. Add a TabControl
3. Add a TabPage by right-clicking the Tabcontrol and selecting "Add Tab"

The TabPage is actually added to the form, not just visually, but the code
is added to the "Windows Form Designer generated code" region.

I want to be able to do this myself with a control I created. In other words:

1. Take a windows form.
2. Add myControl
3. Add mySubControl by right-clicking myControl and selecting "Add
SubControl"

Then the new subcontrol is added to the form as well as to the "Windows Form
Designer generated code" region.

So WHO knows the secret???
 
Zorpiedoman
The TabPage is actually added to the form, not just visually, but the code
is added to the "Windows Form Designer generated code" region.

This above is impossible because you are working at runtime not in
designtime

However adding a tabpage at runtime is very simple and you can set it in
every sub or function.

\\\
Me.TabPage1.Location = New System.Drawing.Point(4, 22)
Me.TabPage1.Name = "TabPage1"
Me.TabPage1.Size = New System.Drawing.Size(192, 74)
Me.TabPage1.TabIndex = 0
Me.TabPage1.Text = "TabPage1"
Me.TabControl1.Name = "TabControl1"
///

I just copied the text above from the designer part

I hope this helps?

Cor
 

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

Back
Top