A simple implementation of a Virtual ListBox. A virtual ListBox contains no data, instead it just allocates space for a specified number of rows. Whenever a row needs to be shown, the OnDrawItem method is fired which in turn fires the DrawItem event.
Inheritance: System.Windows.Forms.ListBox
Exemple #1
0
            /// <summary>
            /// Constructs a new instance of this class.
            /// </summary>
            /// <param name="owner">The <see cref="VListBox"/> which owns the collection.</param>
            public SelectedIndexCollectionEnumerator(VListBox owner)
            {
                int selCount = SendMessage(owner.Handle, LB_GETSELCOUNT, 0, IntPtr.Zero);

                if (selCount > 0)
                {
                    buf = Marshal.AllocCoTaskMem(4 * selCount);
                    SendMessage(owner.Handle, LB_GETSELITEMS, selCount, buf);
                }
            }
Exemple #2
0
 /// <summary>
 /// Constructs a new instance of this class.
 /// </summary>
 /// <param name="owner">The <see cref="VListBox"/> which owns the collection.</param>
 public SelectedIndexCollectionEnumerator(VListBox owner)
 {
     int selCount = SendMessage(owner.Handle, LB_GETSELCOUNT, 0, IntPtr.Zero);
     if (selCount > 0)
     {
         buf = Marshal.AllocCoTaskMem(4 * selCount);
         SendMessage(owner.Handle, LB_GETSELITEMS, selCount, buf);
     }
 }
Exemple #3
0
 /// <summary>
 /// Creates a new instance of this class
 /// </summary>
 /// <param name="owner">The VListBox which owns the collection</param>
 public SelectedIndexCollection(VListBox owner)
 {
     this.owner = owner;
 }
Exemple #4
0
 /// <summary>
 /// Creates a new instance of this class
 /// </summary>
 /// <param name="owner">The VListBox which owns the collection</param>
 public SelectedIndexCollection(VListBox owner)
 {
     this.owner = owner;
 }