Home > Blockchain >  UWP TabView change tab programatically
UWP TabView change tab programatically

Time:10-22

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.

CodePudding user response:

According to this note

You can do it by the following:

// Only select the tab if it is in the list
if (tabToSelect < TabRoot.TabItems.Count)
{
    TabRoot.SelectedIndex = tabToSelect;
}

CodePudding user response:

In C you have to do it as following:

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