0
我有4个选项卡,点击按钮移动到前面它应该改变标签下一个。但是在四个标签中,标签2是隐藏的,我不希望它显示。所以如果屏幕在标签1处,在向前移动时它应该显示标签3,并且在标签3中它应该打开标签4.同样如果在标签3处移回,它应该转到标签1而不显示标签2。此实现,但它还是到标签2.切换按钮点击wpf
private void movefront_click(object sender, RoutedEventArgs e)
{
if (tabIUWM.SelectedIndex == 2)
{
TabStudyAreaInterface.Visibility = Visibility.Visible; //tabstudyareainterface is the name of tab 2
}
else
{
tabIUWM.SelectedIndex = tabIUWM.SelectedIndex + 1;
}
}
private void moveback_click(object sender, RoutedEventArgs e)
{
if (tabIUWM.SelectedIndex == 2)
{
TabStudyAreaInterface.Visibility = Visibility.Visible;
}
else
{
tabIUWM.SelectedIndex = tabIUWM.SelectedIndex - 1;
}
if (tabIUWM.SelectedIndex == -1)
{
MessageBox.Show("This is the beginning screen");
}
}
谢谢:)
避免()原样。改用你的x:Name =“TabName”。 TabName.PrevVisibleTab()起作用 –