Results 1 to 6 of 6

Thread: Tab order

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2008
    Posts
    65

    Tab order

    Hi guys a quick question

    I just want to ask how you code in visual basic the following scenario.

    Example i have four(4) tabpage in a tab control
    when the selected tabpage = to my Inventory tab page it will call a certain function else it will end the process..

    Something like that po..

    Thanks

  2. #2
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: Tab order

    Handle the TabControls SelectedIndexChanged event. You can evaluate the SelectedTab or SelectedIndex properties to know what Tab was selected.
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

  3. #3
    Hyperactive Member Zeljko's Avatar
    Join Date
    Oct 2006
    Location
    Internet
    Posts
    441

    Re: Tab order

    Can you clarify yours question.
    Did you mean
    When (Selected Tabpage) is equal to (to)
    When (Selected Tabpage) = (to)?
    If yes what is 'to'?
    1. If this post helped you, please Rate it = That's You, saying Thanks, to Me ...Left side of this post: [Rate this post]
    2. Mark this Thread Resolved if your question has been answered That's You, saying Thanks, to Group ...Menu on top of your original Post: [Thread Tools]>[Mark Thread Resolved]
    3.
    Check my site: www.er-ef.netCheck my snippets: Get installed .NET versionsRegex extractingJoin hierarchically nested Datatables in one flattened Datatable


  4. #4
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Tab order

    Well, lets say your Inventory tab page is named InventoryTab you could do this in the SelectedIndexChanged event handler of your tab control:
    vb Code:
    1. If MyTabControl.SelectedTab.Name = "InventoryTab" Then
    2. 'Run your method here
    3. End If

    That help?
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Tab order

    Quote Originally Posted by chris128
    Well, lets say your Inventory tab page is named InventoryTab you could do this in the SelectedIndexChanged event handler of your tab control:
    vb Code:
    1. If MyTabControl.SelectedTab.Name = "InventoryTab" Then
    2. 'Run your method here
    3. End If

    That help?
    You should use the objects themselves instead of strings to identify them wherever possible:
    vb.net Code:
    1. If MyTabControl.SelectedTab Is Me.InventoryTab Then
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6
    Pro Grammar chris128's Avatar
    Join Date
    Jun 2007
    Location
    England
    Posts
    7,604

    Re: Tab order

    Oh right, cool thanks for the tip
    My free .NET Windows API library (Version 2.2 Released 12/06/2011)

    Blog: cjwdev.wordpress.com
    Web: www.cjwdev.co.uk


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width