visual studio – Displaying a Selected Value from a combo box into a textbox (or label) in c# without pressing a button

0
20

I am trying to display a selected time from a combobox into a textbox in c#… the user clicks on a value from a combo box and the textbox automatically populates with the selected value… anyone know how to do this?

    //Method for combobox followed by method for textbox
    private void UnderGroundTime_SelectedIndexChanged(object sender, EventArgs e)
    {
        obj.underground = UnderGroundTime.SelectedItem.ToString();
    }

    private void GrandTotalBox_TextChanged(object sender, EventArgs e)
    {
        GrandTotalBox.Text = UnderGroundTime.SelectedItem.ToString();
    }

LEAVE A REPLY

Please enter your comment!
Please enter your name here