Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Change Tab of TabControl via Code

Posted on by 110

Hello,

is it possible to change the currently selected tab of a tabControl via code?

Classic Client - Dynamics NAV 2009 R2

Thanks in advance

Daniel

*This post is locked for comments

  • SubNatural Profile Picture
    SubNatural 110 on at
    RE: Change Tab of TabControl via Code

    Thanks for the hint using the ACTIVATE-Function of a control placed inside the tabPage.

    Works very well.

    The button is also setting a filter on the subform and some other things, so it really was necessary.  

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Change Tab of TabControl via Code

    have you tried picking a field that exists on tab2 and using the ACTIVATE function?

    The real question is that if you have to click some button anyway - why not click TAB2?

    it's the same amount of clicks?

  • Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Change Tab of TabControl via Code

    No, as per my knowledge..

  • SubNatural Profile Picture
    SubNatural 110 on at
    RE: Change Tab of TabControl via Code

    So it is not possible to directly select the required tab (maybe by settings an index or something like that)?

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Change Tab of TabControl via Code

    You can send some Key Board Shortcuts via Shell commands Like

    Ctrl+Page Up for Next Tab

    Ctrl+Page Down for Previous tab

  • SubNatural Profile Picture
    SubNatural 110 on at
    RE: Change Tab of TabControl via Code

    Well I want to show for example 'Tab 2' when I press the button

     

    In C# it would be done by following code:

    tabControl1.SelectedTab = tabControl1.TabPages[NumberOfTabControl];

  • Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: Change Tab of TabControl via Code

    Can you be more clear with an example please?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans