In Visual c# Express Edition, is it possible to make some (but not all) items in a ListBox bold? I can\'t find any sort of option for this in the API.
To add to Mindaugas Mozūras's solution, I had a problem where my e.Bounds
wasn't large enough and text was getting cut off. To solve this problem (thanks to a post here), you override the OnMeasureItem
event and changes your DrawMode to DrawMode.OwnerDrawVariable
.
In designer:
listBox.DrawMode = DrawMode.OwnerDrawVariable;
In handler:
void listBox_MeasureItem(object sender, MeasureItemEventArgs e)
{
e.ItemHeight = 18;
}
Solved my issues of having the height cut off text.