1 class ListViewNF : System.Windows.Forms.ListView
2 {
3 public ListViewNF()
4 {
5 //Activate double buffering
6 this.SetStyle(ControlStyles.OptimizedDoubleBuffer |
7 ControlStyles.AllPaintingInWmPaint, true);
8
9 //Enable the OnNotifyMessage event so we get
10 //a chance to filter out Windows messages before
11 //they get to the form's WndProc
12 this.SetStyle(ControlStyles.EnableNotifyMessage, true);
13 }
14
15 protected override void OnNotifyMessage(Message m)
16 {
17 //Filter out the WM_ERASEBKGND message
18 if (m.Msg != 0x14)
19 {
20 base.OnNotifyMessage(m);
21 }
22 }
23 }
24