By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,465 Members | 1,511 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,465 IT Pros & Developers. It's quick & easy.

CheckedListBox Bold Item

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

Thanks,
John
Jan 24 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
John wrote:
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>

--
Larry Lard
la*******@googlemail.com
The address is real, but unread - please reply to the group
For VB and C# questions - tell us which version
Jan 25 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.