RobotStudio event

Accesing control property via string

Options
Hi

I have tried to create a .Net method which I could call from ScreenMaker application. The method should change the index of the tab control which is created in ScreenMaker. The idea is to change the tab automatically when user has clicked a button in current tab. I tried to find how to access the control property via string, so I could just pass the name of the tabControl to .Net method as a string parameter. 

I found some help from google and tried to test it in normal FP SDK application before trying to implement that in SM. The example said that this syntax below should do the trick, but I'm only receiving two error messages when building the application.

this.Controls["tabControl1"].SelectedIndex = 2;

Error 1  The best overloaded method match for 'System.Windows.Forms.Control.ControlCollection.this[int]' has some invalid arguments

Error 2  Argument '1': cannot convert from 'string' to 'int'

Does anyone know what I'm doing wrong? Or is there any other way to access controls made in ScreenMaker?

-Osku

Comments