mail-archives/mono-bugs/2009-February/086239.html

187 строки
5.2 KiB
HTML
Исходник Обычный вид История

2019-06-06 22:03:35 +03:00
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-bugs] [Bug 477438] Virtual/ownerdraw Listview cant handle &gt;16 item
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20477438%5D%20Virtual/ownerdraw%20Listview%20cant%20handle%20%3E16%0A%09item&In-Reply-To=bug-477438-28286%40https.bugzilla.novell.com/">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="086236.html">
<LINK REL="Next" HREF="086250.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-bugs] [Bug 477438] Virtual/ownerdraw Listview cant handle &gt;16 item</H1>
<B>bugzilla_noreply at novell.com</B>
<A HREF="mailto:mono-bugs%40lists.ximian.com?Subject=%5BMono-bugs%5D%20%5BBug%20477438%5D%20Virtual/ownerdraw%20Listview%20cant%20handle%20%3E16%0A%09item&In-Reply-To=bug-477438-28286%40https.bugzilla.novell.com/"
TITLE="[Mono-bugs] [Bug 477438] Virtual/ownerdraw Listview cant handle &gt;16 item">bugzilla_noreply at novell.com
</A><BR>
<I>Wed Feb 18 18:19:02 EST 2009</I>
<P><UL>
<LI>Previous message: <A HREF="086236.html">[Mono-bugs] [Bug 477438] Virtual/ownerdraw Listview cant handle &gt;16 item
</A></li>
<LI>Next message: <A HREF="086250.html">[Mono-bugs] [Bug 477438] Virtual/ownerdraw Listview cant handle &gt;16 item
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#86239">[ date ]</a>
<a href="thread.html#86239">[ thread ]</a>
<a href="subject.html#86239">[ subject ]</a>
<a href="author.html#86239">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE><A HREF="https://bugzilla.novell.com/show_bug.cgi?id=477438">https://bugzilla.novell.com/show_bug.cgi?id=477438</A>
User <A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">Dax at daxxfiles.net</A> added comment
<A HREF="https://bugzilla.novell.com/show_bug.cgi?id=477438#c2">https://bugzilla.novell.com/show_bug.cgi?id=477438#c2</A>
--- Comment #2 from - - &lt;<A HREF="http://lists.ximian.com/mailman/listinfo/mono-bugs">Dax at daxxfiles.net</A>&gt; 2009-02-18 16:19:02 MST ---
I use mono svn. And it seems that I didn't mention something :/
This version _does_ die.
using System;
using System.Windows.Forms;
public class Test
{
static void Main ()
{
Application.Run (new TestForm ());
}
}
public class TestForm : Form
{
ListView lv;
ListViewItem [] items_cache;
public TestForm ()
{
lv = new ListView ();
lv.VirtualMode = true;
lv.RetrieveVirtualItem += RetrieveVirtualItemHandler;
lv.Dock = DockStyle.Fill;
lv.Columns.Add (&quot;One&quot;);
lv.Columns.Add (&quot;Two&quot;);
lv.View = View.Details;
lv.FullRowSelect = true;
lv.OwnerDraw = true;
lv.DrawItem += DrawListViewItemHandler;
lv.DrawColumnHeader += DrawListViewColumnHeaderHandler;
lv.Parent = this;
items_cache = new ListViewItem [lv.VirtualListSize];
lv.VirtualListSize = 17;
lv.Refresh();
}
void DrawListViewColumnHeaderHandler (object o,
DrawListViewColumnHeaderEventArgs args)
{
args.DrawDefault = true;
}
void DrawListViewItemHandler (object o, DrawListViewItemEventArgs args)
{
args.DrawDefault = true;
}
void RetrieveVirtualItemHandler (object o, RetrieveVirtualItemEventArgs
args)
{
if (items_cache [args.ItemIndex] == null) {
ListViewItem item = new ListViewItem (&quot;Item &quot; +
args.ItemIndex);
item.SubItems.Add (&quot;Sub item &quot; + args.ItemIndex +
&quot;-1&quot;);
items_cache [args.ItemIndex] = item;
}
args.Item = items_cache [args.ItemIndex];
}
}
--
Configure bugmail: <A HREF="https://bugzilla.novell.com/userprefs.cgi?tab=email">https://bugzilla.novell.com/userprefs.cgi?tab=email</A>
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="086236.html">[Mono-bugs] [Bug 477438] Virtual/ownerdraw Listview cant handle &gt;16 item
</A></li>
<LI>Next message: <A HREF="086250.html">[Mono-bugs] [Bug 477438] Virtual/ownerdraw Listview cant handle &gt;16 item
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#86239">[ date ]</a>
<a href="thread.html#86239">[ thread ]</a>
<a href="subject.html#86239">[ subject ]</a>
<a href="author.html#86239">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-bugs">More information about the mono-bugs
mailing list</a><br>
</body></html>