Tab Control with Menu bar

  • Thread starter Thread starter nsreddi
  • Start date Start date
N

nsreddi

I am having Tab Control on my Window Form.I added Two tab pages and
panels on the tab pages.I added two menu items with mnuPrevious and
mnunext.I want to see the Tabpage2 with panel2 on that when I tap on
mnuNext and when I tab mnuPrevious I want to open Tab page1.

What shud I write on the mnuNext and mnuPrevious to achieve this ?

Thanks
NS
 
Hi,

In the event handler for MenuItem Click event, use the SelectedIndex
property of the TabControl to change tabs.

Here it is in C#:

private void menuItem1_Click(object sender, EventArgs e)
{
tabControl1.SelectedIndex = 0;
}

private void menuItem2_Click(object sender, EventArgs e)
{
tabControl1.SelectedIndex = 1;
}

Hope this helps.
Bruce Hamilton
.NET Compact Framework User Education
(e-mail address removed)
 
Back
Top