0

Hello!
I'd like to ask for some help. I have the following code:

private void Combobox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            runstylize(lCombobox1, leftborderstyle, "left");

        }
 public void getborderstyle(ComboBox x, string y, string z)
        {
           
            y = z+"-was set to:" + x.SelectedItem.ToString() ;
            
            change();
           
        }

My question is: why is the string "leftborderstyle" (which become y in my logic) hasn't got any value after the proccess? It is a public string, defined in the initializecomponent section. What should I do to set y's value to it?

Thanks in advance!

3
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by skatamatic
0

Try passing the string by reference. In this case, just do this:

private void Combobox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            runstylize(lCombobox1, ref leftborderstyle, "left");

        }
 public void getborderstyle(ComboBox x, ref string y, string z)
        {
           
            y = z+"-was set to:" + x.SelectedItem.ToString() ;
            
            change();
           
        }
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.