szabopeter2011 szabopeter2011 - 9 months ago 42 Question

How to get tab page's index by its name in VB.NET?

I'm trying to get a dynamically created tab page's index by its name with no luck. Any help would be appreciated!

Thank you in advance!


You can use linq to search the tabpages' properties and return the index:

Dim i As Integer = Enumerable.Range(0, TabControl1.TabPages.Count).Where(Function(x) TabControl1.TabPages(x).Name.Equals("TabPage1")).FirstOrDefault