[Mono-bugs] [Bug 436790] ComboBox.OnDrawItem() invoked with useless data

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 22 12:49:36 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=436790

User awunwpa7 at yahoo.com.ph added comment
https://bugzilla.novell.com/show_bug.cgi?id=436790#c5





--- Comment #5 from Steve Odbc <awunwpa7 at yahoo.com.ph>  2008-10-22 10:49:35 MDT ---
Will this help? Since the problem is a wrong index. MONO may call OnDrawItems
as often as it likes, but it shouldn't pass an index that doesn't happen on
dotNet.

This is the code I use, and It works perfect on dotNet, tested with a hundred
of items (no negative index, no exception):


protected override void OnDrawItem(DrawItemEventArgs e)
{
     base.OnDrawItem(e);

     // this is what I always do if the frameworks don't match:

     if (Global.UseMonoHacks)
     {
          // only MONO goes here

          if (0 > e.Index) return;
     }

     // ...

     string CurText = this.Items[e.Index].Text

     // ...
}


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list