1234567891011121314151617181920212223242526272829303132333435363738 |
- using System;
- using System.Collections;
- using System.Reflection;
- using System.Windows.Forms;
- namespace FastReport.Controls
- {
- internal sealed class ExtListView : ListView
- {
- public event EventHandler FetchMoreItems;
- public ExtListView()
- {
- var pi = this.Controls.GetType().GetProperty("ImplicitControls", BindingFlags.NonPublic | BindingFlags.Instance);
- if (pi != null)
- {
- var arrayList = pi.GetValue(this.Controls) as ArrayList;
- if (arrayList != null)
- {
- foreach (var item in arrayList)
- {
- if (item is VScrollBar sc)
- {
- sc.ValueChanged += (s, e) =>
- {
- if (sc.Maximum - sc.LargeChange <= sc.Value)
- {
- FetchMoreItems?.Invoke(this, e);
- }
- };
- }
- }
- }
- }
- }
- }
- }
|