Search code examples
c++uwptabview

UWP TabView change tab programatically


How can I change TabView's tab programatically? For example user have 2'nd tab opened and I want to change tab to the first one.


Solution

  • In C++ you have to do it as following:

    int index = 1;
    if (tabcontrol->TabItems->Size > index)
    {
        tabcontrol->SelectedIndex = index;
    }