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

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
however now nuthing opens when i click....

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


hi! please try this

Dim frmMMF7 As New frmGenerateEtimateP
        frmMMF7.MdiParent = Me
        With frmMMF7
        End With

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

form1.MdiParent = Me

& 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.