0

I have one main and one sub form. Sub form consist of a "TabControl" that includes "settings" and "about" tab pages. When in main form, i want to click "Settings"" button to open this sub form and focus on "settings" tab and also do this behaviour for "about" button, focus on "about" tab. How can I do that ?

Bora
  • 39
  • 6
  • The most simple option would be making the `TabControl` public by changing its `Modifires` property at design-time to `Public`. Then you can set its `SelectedIndex` using `var f = new MySecondForm(); f.tabControl1.SelectedIndex = 1; f.ShowDialog();`. Also as another option you can pass the desired index to the constructor of your second form and set selected index in the new constructor or form load event. Take a look at [Interaction between forms — How to change a control of a form from another form?](http://stackoverflow.com/a/38769212/3110834) – Reza Aghaei Nov 01 '16 at 22:46
  • that works, thanks. – Bora Nov 02 '16 at 00:24

0 Answers0