Click here to Skip to main content
15,921,905 members
Home / Discussions / C#
   

C#

 
QuestionRe: Predictive Search within C# Windows Form? Pin
Paul Conrad16-Jul-08 4:41
professionalPaul Conrad16-Jul-08 4:41 
AnswerRe: Predictive Search within C# Windows Form? Pin
Ian Uy16-Jul-08 5:08
Ian Uy16-Jul-08 5:08 
GeneralMessage Removed Pin
16-Jul-08 5:35
tkrn16-Jul-08 5:35 
GeneralRe: Predictive Search within C# Windows Form? Pin
Ian Uy16-Jul-08 5:55
Ian Uy16-Jul-08 5:55 
GeneralMessage Removed Pin
16-Jul-08 8:40
tkrn16-Jul-08 8:40 
GeneralRe: Predictive Search within C# Windows Form? Pin
Luc Pattyn16-Jul-08 8:57
sitebuilderLuc Pattyn16-Jul-08 8:57 
Questionlistbox item colour Pin
arkiboys16-Jul-08 3:23
arkiboys16-Jul-08 3:23 
AnswerRe: listbox item colour Pin
Luc Pattyn16-Jul-08 3:53
sitebuilderLuc Pattyn16-Jul-08 3:53 
Hi,

there are two basic features you need:
- ListBoxes can contain items of any type, not just strings
- you can paint those items yourself (DrawMode OwnerDrawn, event DrawItem)

So the neat way to do this is define a little class (say MyItem) and let it hold a string and
some style field (maybe a Color). Add instances of that class to the ListBox, make it OwnerDrawn,
and provide a DrawItem handler according to your wishes.

As a shortcut, when I only need two variations (say black and red), I skip the MyItem stuff and
prefix the red items with a special character (say '~'), then in DrawItem check the first char,
and if a '~', choose Color.Red and drop the '~'.

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

Voting for dummies? No thanks. Dead | X|


GeneralRe: listbox item colour Pin
arkiboys16-Jul-08 3:58
arkiboys16-Jul-08 3:58 
GeneralRe: listbox item colour Pin
Luc Pattyn16-Jul-08 4:12
sitebuilderLuc Pattyn16-Jul-08 4:12 
GeneralRe: listbox item colour Pin
arkiboys16-Jul-08 4:15
arkiboys16-Jul-08 4:15 
JokeRe: listbox item colour Pin
Paul Conrad16-Jul-08 9:39
professionalPaul Conrad16-Jul-08 9:39 
AnswerRe: listbox item colour Pin
0x3c016-Jul-08 3:55
0x3c016-Jul-08 3:55 
GeneralRe: listbox item colour Pin
arkiboys16-Jul-08 4:07
arkiboys16-Jul-08 4:07 
GeneralRe: listbox item colour Pin
0x3c016-Jul-08 4:22
0x3c016-Jul-08 4:22 
GeneralRe: listbox item colour Pin
arkiboys16-Jul-08 20:59
arkiboys16-Jul-08 20:59 
QuestionTreeview Event Pin
Agweet16-Jul-08 3:20
Agweet16-Jul-08 3:20 
AnswerRe: Treeview Event Pin
Jimmanuel16-Jul-08 4:45
Jimmanuel16-Jul-08 4:45 
QuestionEmbeded resources Pin
hadad16-Jul-08 1:38
hadad16-Jul-08 1:38 
AnswerRe: Embeded resources [modified] Pin
enginço16-Jul-08 2:14
enginço16-Jul-08 2:14 
AnswerRe: Embeded resources Pin
Thomas Stockwell16-Jul-08 4:40
professionalThomas Stockwell16-Jul-08 4:40 
Questionsetup that update it self` Pin
ali zaidi16-Jul-08 0:28
ali zaidi16-Jul-08 0:28 
AnswerRe: setup that update it self` Pin
Ashfield16-Jul-08 1:16
Ashfield16-Jul-08 1:16 
QuestionForEach Loop Pin
Agweet15-Jul-08 22:33
Agweet15-Jul-08 22:33 
AnswerRe: ForEach Loop Pin
J4amieC15-Jul-08 22:37
J4amieC15-Jul-08 22:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.