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)
 

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

Similar Threads

Tab control question 1
How to set Tab Control visible property to False !!!! 2
Changing Tab Pages 3
Menu Control 9
Button not visible in TabPage 2
Tab Order 2
Tab Control 1
Frame control scroll bar 0

Back
Top