sender parameter is null in ListBox.SelectedIndexChanged

119 Views Asked by At

I have a WinForm application with a ListBox containing few list items. In the InitializeComponent(), The ListBox has a listBoxSelectedIndexChanged event attached.

By default, the first item is selected and SelectedIndexChanged event gets triggered but sender parameter is null, in the listBoxSelectedIndexChanged(object sender, System.EventArgs e).

Only after I click on an item in the ListBox, the sender parameter holds some value.

Any possible solutions so that sender parameter holds some value if the ListBox has first item preselected?

0

There are 0 best solutions below