I am using a listbox in my C#2.0 windows forms application. The method to populate the list box is
private void PopulateListBox(ListBox lb, ReportColum
private void PopulateListBox(ListBox lb, ReportColumnList reportColumnList)
{
lb.SelectedIndexChanged -= this.*MethodnamewhichhandlesthisEvent*; //unset eventhandler
lb.DataSource = reportColumnList.ReportColumns;
lb.DisplayMember = "ColumnName";
lb.ValueMember = "ColumnName";
lb.SelectedIndexChanged += this.*MethodnamewhichhandlesthisEvent*; //set the eventhandler
}
Basically remove the delegate from the event and then add once you are done.