-
Tabcontrol selecting one of the pages
I have a tab control with 4 pages on it, on a form, I have a button on the
same form and I am trying to make that button select a different tab. Any
Ideas...
Thanks!
-
Re: Tabcontrol selecting one of the pages
Here's some code from one of my programs, hope it helps
Dim bttn As Button, cntl As Control
bttn = sender
For Each cntl In Me.Panel2.Controls
If (TypeOf (cntl) Is Button) And (cntl.Tag = "panel") Then
CType(cntl, Button).FlatStyle = FlatStyle.Standard
End If
Next
bttn.FlatStyle = FlatStyle.Flat
Select Case bttn.Name
Case bttnCustomers.Name
TabControl1.SelectedTab = TabPage1
Case bttnAddresses.Name
TabControl1.SelectedTab = TabPage2
Case bttnRentalTickets.Name
TabControl1.SelectedTab = TabPage3
Case bttnOnRent.Name
TabControl1.SelectedTab = TabPage4
Case bttnInvoices.Name
TabControl1.SelectedTab = TabPage5
End Select
-
Re: Tabcontrol selecting one of the pages
Kevin,
This is what I was looking for!!!
Thanks So much!!
K
"Kevin" <vb.@127.0.0.1> wrote:
>
>Here's some code from one of my programs, hope it helps
>
>
> Dim bttn As Button, cntl As Control
> bttn = sender
> For Each cntl In Me.Panel2.Controls
> If (TypeOf (cntl) Is Button) And (cntl.Tag = "panel") Then
> CType(cntl, Button).FlatStyle = FlatStyle.Standard
> End If
> Next
> bttn.FlatStyle = FlatStyle.Flat
> Select Case bttn.Name
> Case bttnCustomers.Name
> TabControl1.SelectedTab = TabPage1
> Case bttnAddresses.Name
> TabControl1.SelectedTab = TabPage2
> Case bttnRentalTickets.Name
> TabControl1.SelectedTab = TabPage3
> Case bttnOnRent.Name
> TabControl1.SelectedTab = TabPage4
> Case bttnInvoices.Name
> TabControl1.SelectedTab = TabPage5
> End Select
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks