Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Loop through Tabs in C#

Former Member
0 Likes
554
  • SAP Managed Tags

Hi all,

I am able to connect to SAP WinGUI and search all the objects. This is in c#.

The only thing that doesn't work is to loop through the tabs. I get an SAP error, when I have Selected a Tab.

My code is the following (for now).

What am I doing wrong here?

                    GuiTabStrip objGuiTabStrip = (node as GuiTabStrip);
                    for (int i = 0; i < intNumberOfTabs; i++)
                    {
                        string strTab = objGuiTabStrip.Children.Item(i).Id.ToString(); // --> here the errors drops in the second iteration
                        string strTabType = objGuiTabStrip.FindById(strTab).Type.ToString();

                        GuiTab objGuiTab = (GuiTab)objGuiTabStrip.FindById(strTab);
                        string strGuiTab = objGuiTab.Text;
                        
                        GuiTab blabla = (GuiTab)session.FindById(strTab);
                        blabla.Select();   

                        Console.WriteLine(strTab + " - " + strTabType + " - " + strGuiTab);

                    }
0 REPLIES 0