Home All Groups Group Topic Archive Search About

Open a form and select the tab page

Author
12 Apr 2005 9:39 PM
lukegregory
How can I make a hyperlink open another form and select the specified tab
page on that form.

I have declared the form I want to open as "Details" so:

Details.Show()

Opens the form. And to select the tab page I can use:

MainTabControl.SelectedTab = SearchTabPage

However I cannot combine these two commands into one click action.

Can anyone help?

Thanks

Author
12 Apr 2005 9:55 PM
Herfried K. Wagner [MVP]
Show quote Hide quote
"lukegregory" <lukegreg***@discussions.microsoft.com> schrieb:
> How can I make a hyperlink open another form and select the specified tab
> page on that form.
>
> I have declared the form I want to open as "Details" so:
>
> Details.Show()
>
> Opens the form. And to select the tab page I can use:
>
> MainTabControl.SelectedTab = SearchTabPage
>
> However I cannot combine these two commands into one click action.


What's the problem?

\\\
Dim d As New DetailsForm()
d.MainTabControl.SelectedIndex = 2
d.Show()
///

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
12 Apr 2005 10:27 PM
lukegregory
Thank you ever so much, simple mistake, I had the two commands in the wrong
order and it would not work. I am still in the early stages of learning
VB.Net and sadly my deadline is fast approaching. Would it be possible to
email you a zipped copy of my application to clear up a few bugs for me, this
would be greatly appreciated. I am happy to offer you a reasonable agreed for
for this service.


Show quoteHide quote
"Herfried K. Wagner [MVP]" wrote:

> "lukegregory" <lukegreg***@discussions.microsoft.com> schrieb:
> > How can I make a hyperlink open another form and select the specified tab
> > page on that form.
> >
> > I have declared the form I want to open as "Details" so:
> >
> > Details.Show()
> >
> > Opens the form. And to select the tab page I can use:
> >
> > MainTabControl.SelectedTab = SearchTabPage
> >
> > However I cannot combine these two commands into one click action.
>
>
> What's the problem?
>
> \\\
> Dim d As New DetailsForm()
> d.MainTabControl.SelectedIndex = 2
> d.Show()
> ///
>
> --
>  M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
>  V B   <URL:http://classicvb.org/petition/>
>
>