Question List control that allows font formatting for individual items

ChuckPuckett

New member
Joined
Nov 13, 2022
Messages
3
Programming Experience
10+
I need a present a list of words that the user can multi-select from, and which I can also change the font color and background for individual words. This is for summary at the end of a round in a word game, and I want to give feedback as to which strings were illegal, which are duplicates, etc.

ListBox of course allows user multiselect, but I can't figure out how to hilite "bad" words.

Any suggestions?
 
Easiest would be to do things in the WPF list control, but with WinForms, you'll need to do owner drawn.
 
This is not a question about the VS IDE so it doesn't belong in a forum dedicated to that subject. Please post in the forum most applicable to the subject, not just the first one in the list. I will assume that you are talking about a WinForms app and move this thread to the Windows Forms forum. If that's not what you want, please specify and we'll move it again.
 
Assuming that it is a WinForms ListBox you're talking about, you would need to owner-draw, as previously mentioned. That means setting the DrawMode to (probably) OwnerDrawFixed and then handling the DrawItem event to draw each item in whatever way you want.
 
Back
Top Bottom