I have an owner-driven list control.
The problem is that sometimes the DrawItemEventArgs argument passed to my DrawItem event handler has an Index property of โ-1โ. This is my unethical solution:
private void lstBox_DrawItem(object sender, DrawItemEventArgs e) { if (e.Index >= 0) { handler implementation } }
I would like to know what usually causes a negative index for the handler.
source share