Solved

Syntax for TabControl

Posted on 2010-11-21
2
392 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

746 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

12 Experts available now in Live!

Get 1:1 Help Now