Click to See Complete Forum and Search --> : to activate tabpage from a menu


kobedexter
April 26th, 2006, 02:33 PM
hi to all

My problem is the following

I have a TabControl with 8 Tabpages and I also have a menu with 8 menuitems

How I can call to each one of the tabpage with menu click

I am making this way it, But it doesn't work with all the menuitem




Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
TabPage1.Select()
TabPage1.Show()
End Sub
Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
TabPage2.Select()
TabPage2.Show()
End Sub
.
.
.
Private Sub MenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem8.Click
TabPage8.Select()
TabPage8.Show()
End Sub




Some suggestion of as I can to activate or to call the TabPage giving click in any MenuItem

kebo
April 26th, 2006, 03:16 PM
assuming your tabpages have been added to TabControl1 use the following

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click
TabControl1.SelectedTab = TabPage1
End Sub

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
TabControl1.SelectedTab = TabPage2
End Sub
.
.
.
Private Sub MenuItem8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem8.Click
TabControl1.SelectedTab = TabPage8
End Sub

kobedexter
April 26th, 2006, 03:59 PM
Thank you and I appreciate your help

A thousand thank you KEBO

kebo
April 26th, 2006, 04:50 PM
Thank you and I appreciate your help

A thousand thank you KEBO
you're welcome and i would settle for a single rep :D