Solved

Syntax for TabControl

Posted on 2010-11-21
2
394 Views
Last Modified: 2012-05-10
Hi. I am working with a TabControl that has three tabs.  I need the syntax to determiine what tab page the user is on.   Here are the names of the controls that I'm using:

tabWebBook - name of the tab control
tabPageWebSites - name of tab page 1
tabPageCreditCards - name of tab page 2
tabPageSettings - name of tab page 3

I am working on a Case statement and need the correct syntax for the following:
select case tabWebBook.tabPageWebSites
                  ' do something
           case tabWebBook.tabPageCreditCards
                   ' do something
           case tabWebBook.tabPageSettings
                   ' do something
end select

Thanks!
0
Comment
Question by:Agent909
2 Comments
 
LVL 3

Accepted Solution

by:
Shane32EE earned 500 total points
ID: 34184515
When using the If statement, it would look like this:

If tabWebBook.SelectedTab Is tabPageWebSites Then
 ' do something
ElseIf tabWebBook.SelectedTab Is tabPageCreditCards Then
 ' do something
ElseIf tabWebBook.SelectedTab Is tabPageSettings Then
 ' do something
End If

The Select Case statement does not support the Is comparison.  But you can use the SelectedIndex property like this:

Select Case tabWebBook.SelectedIndex
  Case 0 'first tab (tabPageWebSites)
    'do something
  Case 1 'second tab (tabPageCreditCards)
    'do something
  Case 2 'third tab (tabPageSettings)
    'do something else
End Select
0
 
LVL 1

Author Closing Comment

by:Agent909
ID: 34184533
I tested it, and it works great!  Thank you.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Multiple file Upload asp.net 2 49
VB.Net - Project Software to help the Developer 7 33
VB 2005 Tooltips on Form Load Event 15 29
get column names from table in vb.net 8 26
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now