Combox SelectedIndexChanged fires when close the WinForm
<p>I am using Combobox SelectedIndexChanged event to perform few tasks. It is working nice. But when i am closing the form, SelectedIndexChanged gets fired and i get "Object reference not set to an instance of an object." exception. My code is following-</p>

<pre><code>    private void cmbProductName_SelectedIndexChanged(object sender, EventArgs e)
    {
        try
        {
            Product p =(Product) cmbProductName.SelectedItem;

            RawItems = RawItem.GetEntityList(p.Id, ConnectionString);

        }
        catch (Exception ex)
        {
            CustomMessageBox.ShowSystemException(ex);
        }
    }
</code></pre>

<p>How to avoid the SelectedIndexChanged event being fired when form is closing?</p>

<p>Thanks
SKPaul.</p>
