Click here to Skip to main content
15,877,051 members
Home / Discussions / C#
   

C#

 
AnswerRe: Add text to listbox with different color Pin
musefan20-Jul-09 6:49
musefan20-Jul-09 6:49 
GeneralRe: Add text to listbox with different color Pin
tamir90120-Jul-09 6:53
tamir90120-Jul-09 6:53 
AnswerRe: Add text to listbox with different color Pin
Luc Pattyn20-Jul-09 6:55
sitebuilderLuc Pattyn20-Jul-09 6:55 
AnswerRe: Add text to listbox with different color Pin
PIEBALDconsult20-Jul-09 7:01
mvePIEBALDconsult20-Jul-09 7:01 
GeneralRe: Add text to listbox with different color Pin
tamir90120-Jul-09 7:23
tamir90120-Jul-09 7:23 
GeneralRe: Add text to listbox with different color Pin
Luc Pattyn20-Jul-09 7:47
sitebuilderLuc Pattyn20-Jul-09 7:47 
GeneralRe: Add text to listbox with different color Pin
tamir90120-Jul-09 8:03
tamir90120-Jul-09 8:03 
GeneralRe: Add text to listbox with different color Pin
Luc Pattyn20-Jul-09 8:10
sitebuilderLuc Pattyn20-Jul-09 8:10 
Hi,

you don't have to worry about the firing of the DrawItem event, it basically works like the Paint event of any Control, i.e. it gets fired by Windows when (part of) the Control needs being redrawn because something happened (a Window on top of it has been removed, the user caused a scroll, whatever) OR your program told the Control something has changed (by calling Refresh or Invalidate).

So make sure the content of your Control is what you want it to be, e.g. on a button click, add an item to the ListBox.Items collection. And if something changes without the control knowing it, tell it to redraw with Invalidate().

Did you look at my example at all?

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

GeneralRe: Add text to listbox with different color Pin
tamir90120-Jul-09 18:32
tamir90120-Jul-09 18:32 
GeneralRe: Add text to listbox with different color Pin
Luc Pattyn21-Jul-09 1:30
sitebuilderLuc Pattyn21-Jul-09 1:30 
Questionhard disk serail number Pin
mokhtar2820-Jul-09 6:21
mokhtar2820-Jul-09 6:21 
AnswerRe: hard disk serail number Pin
Eddy Vluggen20-Jul-09 6:28
professionalEddy Vluggen20-Jul-09 6:28 
GeneralRe: hard disk serail number Pin
Luc Pattyn20-Jul-09 6:57
sitebuilderLuc Pattyn20-Jul-09 6:57 
GeneralRe: hard disk serail number Pin
Eddy Vluggen20-Jul-09 8:20
professionalEddy Vluggen20-Jul-09 8:20 
AnswerRe: hard disk serail number Pin
Luc Pattyn20-Jul-09 7:00
sitebuilderLuc Pattyn20-Jul-09 7:00 
QuestionRe: hard disk serail number Pin
harold aptroot20-Jul-09 10:54
harold aptroot20-Jul-09 10:54 
QuestionCrystalReports Pin
CodingYoshi20-Jul-09 6:06
CodingYoshi20-Jul-09 6:06 
AnswerRe: CrystalReports Pin
CodingYoshi20-Jul-09 13:05
CodingYoshi20-Jul-09 13:05 
AnswerRe: CrystalReports Pin
_Maxxx_20-Jul-09 18:17
professional_Maxxx_20-Jul-09 18:17 
GeneralRe: CrystalReports Pin
CodingYoshi21-Jul-09 4:34
CodingYoshi21-Jul-09 4:34 
Questionwhat to use instead of 'var' in vs 2005 as for the projects developed in vs2005. Pin
svt gdwl20-Jul-09 5:00
svt gdwl20-Jul-09 5:00 
AnswerRe: what to use instead of 'var' in vs 2005 as for the projects developed in vs2005. Pin
Mirko198020-Jul-09 5:05
Mirko198020-Jul-09 5:05 
AnswerRe: what to use instead of 'var' in vs 2005 as for the projects developed in vs2005. Pin
PIEBALDconsult20-Jul-09 5:57
mvePIEBALDconsult20-Jul-09 5:57 
AnswerRe: what to use instead of 'var' in vs 2005 as for the projects developed in vs2005. Pin
Ennis Ray Lynch, Jr.20-Jul-09 7:25
Ennis Ray Lynch, Jr.20-Jul-09 7:25 
GeneralRe: what to use instead of 'var' in vs 2005 as for the projects developed in vs2005. Pin
Luc Pattyn20-Jul-09 7:51
sitebuilderLuc Pattyn20-Jul-09 7:51 

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.