Hello,
When I do that:

tabControl[2].SelectedIndex is equal to 3 for instance
index_of_selected_tab[2] = tabControl[2].SelectedIndex;
tabControl[2].SelectedIndex = 0;

Then, index_of_selected_tab[2] changes value to 0 !!!!!!!!!
In c++, it should be equal to 3.

How to proceed in order to do like in c++ (if I right understood, I am now transmitting by ref, but I would like to transmit by value) ?