I’m having a Windows Forms application with a combobox. I added items to the combobox (for example, 1,2,3,4). If I select an item in the combobox SelectedIndex should be returned to the variable in another class.
class Form1
{
private void Combobox1_SelecetedIndexChanged(object sender,eventArgs e)
{
combobox1.selecetdeIndex ; //I will get the selected index.
//If the selected index is changed then the currentValue in the AnotherClass should be
//changed.
}
}
Class AnotherClass
{
private int currentValue;
//There are some methods which depends on currentValue.
}
Something along these lines: (pseudocode)