how can i link a button and tab control,on click a form is shown in the tab control?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stephen04
    New Member
    • Jul 2010
    • 19

    #1

    how can i link a button and tab control,on click a form is shown in the tab control?

    hi
    I'm using tab control and i have several buttons that when i click on one of the buttons a tab opens in the tab control and the form is shown .how do i this link?

    thanx Stephen
  • Leito
    New Member
    • Apr 2010
    • 58

    #2
    I'm not sure I understand well your request, but you can open a form this way:
    Code:
    Form1 form = new Form1();
    form1.ShowDialog();
    Then, in your form1_Load() method, you can focus on a tab this way:
    Code:
    this.tabControl.SelectedTab = this.tabControl.TabPages[tabFocus];
    // tabFocus = [0..tabs_count]
    Does it answer your question?

    Comment

    • stephen04
      New Member
      • Jul 2010
      • 19

      #3
      well i don't know exactly if it is what i was searching for...because i didn't quite under stood the last part the one for the tabs.. to explain my scenario better i have button A and i have formApples now when i click on button A formApples will appear in the tab control not in a new window. can this happen?

      Comment

      Working...