tags:

views:

519

answers:

3

Hi,

I wanna add new tab page for every newly opened forms. For example ;

frmReport reportform = new frmReport();
report.Show();

/// when i open frmReport form it must be opened in a New TabPage. like as Windows Internet Explorer 7-8 tabpages. Sorry for my english.

A: 

Sorry there is not direct way to do it. Better to go with Usercontrols. Instead of Forms and Add controls to the Tab Page.

Check this link http://k-mug.org/forums/p/360/1200.aspx

Anuraj
+1  A: 

What you would like to achive here is to have "windows inside tab pages". This is not like it supposed to be! It looks like this:

  • Windows OS
  • Windows of applications (Window class)
  • Containers placed on Window (for example: Panel, TabControl!)
  • Controls placed on Windows and Containers (for example: Button, but also containers like Panel!)

So when you look on this you see that it's not ok to put Windows class into TabControl!

So what to do?

Create for example UserControl class and move all your controls from Window to this new UserControl. Next place on your Window TabControl nad on one of it's TabPages put this newly created UserControl.

In this way you'll have a good designed UI. Once again: You do not put Window on your TabPage!

tomaszs
can ya gimme an example or how to do it Article ?
Ibrahim AKGUN
Here you have discussion about this with some code, hope if helps:http://bytes.com/groups/net-c/270457-can-i-add-form-tabpage
tomaszs
A: 

i used DevExpress Controls for tabPages.

Ibrahim AKGUN