DrawMode.OwnerDrawFixed

  • Thread starter Thread starter gadya
  • Start date Start date
G

gadya

I am entering entries into a listbox using 'DrawMode.OwnerDrawFixed'.
I notice that I continually get Draw events with e.index=-1.
Why is this? How should these events be processed?
I note that some posts test the index value and if negative just exit.
Doesn't something more need to be done?
 
You need to ignore it otherwise you'll be throwing exceptions all over the
place due to trying to access non existent indices.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top