Hello
i have a form in which i have 5 tab pages(each with their unique name )and one TabControl
eg. say ...I HAVE admission form under which there are fees, balance enq...tabs......

In MDI i have menuitem under FEES under which i have item Balance enq...etc...
The problem is that when i click on this balance enq...a specific tab (related to balance enq/ named balance) should be opened. how to do this ??

i have tried this :

Dim student As New student_adm
        Dim tabpage3 As New TabPage
        student.TabControl1.SelectTab(tabpage3)

however when i click on the balance in the mdi i get following error :

InvalidArgument=Value of '-1' is not valid for 'index'.
Parameter name: index

So i tried to insert a TabIndex eg
student.TabControl1.SelectTab(1)
however now nuthing opens when i click....

Whts the problem and whts the correct code ??? PLZ Help me out...

cya
Rohan

hi! please try this

Dim frmMMF7 As New frmGenerateEtimateP
        frmMMF7.MdiParent = Me
        frmMMF7.Show()
        With frmMMF7
            .TabControl1.SelectTab(2)
        End With

Hello
suppose u hav an mdi form
& 1 normal form which contains a tab pane wit 3 tabs
the name of the tabs are
tabpage1
tabpage2
tabpage3
you r calling the form from the menu in mdi form
on that menu click jus write

form1.Activate()
form1.MdiParent = Me
form1.Show()

& in form1's load event write

TabControl1.SelectTab(name of the tab pag which u want)

hello laghaterohan!
i tried your suggestion and it work. There are many ways to accomplish a task. Thank you.

This article has been dead for over six months. Start a new discussion instead.