CheckedListBox Bold Item

  • Thread starter Thread starter John
  • Start date Start date
J

John

Is there a way to make the font for the selected item(s) bold in a
CheckedListBox?

Thanks,
John
 
John said:
Is there a way to make the font for the selected item(s) bold in a
CheckedListBox?

Yes, but it's a bit of work. CheckedListBox doesn't expose a DrawMode
property, so easy owner-drawing won't work. Then I thought you could
maybe just subclass and override OnDrawItem, changing the Font when the
item is selected and calling back to base.OnDrawItem, but looking at the
source of CheckedListBox.OnDrawItem shows that it always uses the
control's font.

So the only thing I can see left to do is to subclass, override
OnDrawItem, then do *all* the painting yourself. See this mess for
suggestions, or google 'checkedlistbox ondrawitem'

<http://groups.google.com/group/microsoft.public.dotnet.framework.windowsforms/msg/127d359505ed998b>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top