I want some way to make a given word bold(the first two characters of each item in a listbox), and nothing else, something like this:
01 car
02 house
03 market
As for these three, being items in a listbox control, ALWAYS the first two characters, the rest should not be bold.
Is there any practical way for doing so ?
Data:
- Visual Studio 2008
- .NET 3.5
request:
private void lstMaster_DrawItem(object sender, DrawItemEventArgs e)
{
//TEST
e.DrawBackground();
Brush myBrush = Brushes.Black;
Pen pen = new Pen(myBrush);
e.Graphics.DrawRectangle(pen, 0, 0, 10, 10); //BREAKPOINT HERE
e.Graphics.DrawString("aaa" + lstMaster.Items[e.Index].ToString(),
e.Font, myBrush, e.Bounds, StringFormat.GenericDefault);
e.DrawFocusRectangle();
}
It just keept the same, no rectangle, no "AAA", or square no breakpoint reached...