Checking how many tabs are open

  • Автор темы Автор темы Leszek1
  • Дата начала Дата начала

Leszek1

Новичок
Регистрация
11.11.2017
Сообщения
23
Реакции
4
Баллы
3
Hello, you can have an idea how to check how many tabs are open in the project, and if there are more than one, delete all and leave only the first one. ??? , I thought, I was combining and I have no idea - probably only in c #?
 
how to check how many tabs are open in the project, and if there are more than one, delete all and leave only the first one. ??? , I thought, I was combining and I have no idea - probably only in c #?
Yes, C#...
C#:
Развернуть Свернуть Копировать
//If tabs are more than one
if (instance.AllTabs.Length>1){
    //Delete all and leave only the first one
    for (int i=1; i<instance.AllTabs.Length; i++){
        instance.AllTabs[i].Close();
        i--;
    }
}
 
  • Спасибо
Реакции: Leszek1
C#:
Развернуть Свернуть Копировать
Tab[] tabs = instance.AllTabs;
for (int i = 1; i < tabs.Count(); i++)
    tabs[i].Close();
 
  • Спасибо
Реакции: Leszek1
Super, thanks great, you can always count on help from your side :), thanks
 
  • Спасибо
Реакции: LaGir и Dimionix

Кто просматривает тему: (Всего: 0, Пользователи: 0, Гости: 0)