accessing dynamically created control variables from event handler c#
<p>I have a program that I am trying to write that </p>

<p>one row of the comboboxes and text boxes are created dynamically when you click the plus button that is on the form
and then you can keep clicking the plus and it keeps adding a row but moves the new row down </p>

<p>I have the row organized like this:</p>

<p>there is a comboBox for buildings, then a comboBox for rooms. And that is one row</p>

<p>The building comboboxes have lists of buildings in them, and when I choose an item from the list, I need to populate the room combobox with the list of room numbers that correspond with the building. </p>

<p>I am having an extremely hard time doing this. 
This is what Ive tried.</p>

<p>my row class is what I use to create the new rows.
When I press the button, a new row is created with new comboboxes etc.</p>

<p>Here is my event handler</p>

<pre><code>private void comboBox_SelectedIndexChanged(object sender, EventArgs e)
    {

        ComboBox comboBox = sender as ComboBox;
        if (comboBox.SelectedItem.Equals("ATLC"))
        {
            foreach (int x in row.ATLC)
            {
                row.roomComboBox.Items.Add(x);
            }
        }
</code></pre>

<p>Now my problem is I need to somehow add the corresponding room number data to the roomComboBox associated with the current row, and I dont know how and its driving me nuts.
The sender comboBox is associated with the current row, so is there a way to use the sender to reference the roomComboBox that is a member of the same row??
any help would be great. Ive searched lots of threads on here and cant seem to find an answer. </p>

<p>edit:</p>

<p>Is there a way to reference the object that a variable belongs to.
If I could somehow reference the row object of the sender comboBox then i might could use that to reference the room comboBox of the same row object...maybe? somehow? please?</p>
