Hi All-
Is it me or can I only set the itemheight - e.ItemHeight - once for a listbox?
Although I handle the MeasureItemEvent on my ownerdrawn listbox and set the e.ItemHeight to the right value, only the first height that is set will be used.
Oops, I am new to this, sorry about that. This is the code (DrawItemHandler is of course in the actual program):
// Add eventhandler to draw and measure items
this.listBox1.DrawItem += new DrawItemEventHandler(this.DrawItemHandler);
this.listBox1.MeasureItem += new MeasureItemEventHandler(this.MeasureItemHandler);
// The eventhandler itself
private void MeasureItemHandler(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = Convert.ToInt32(mySettings.iCurrentSizeFactor * 10) + 1;
}