<pre> Thread thFollowListView = new Thread(new ThreadStart(FollowListViewRowIndex)); thFollowListView.Start(); int iRowIndex = 0; private void FollowListViewRowIndex() { while (true) { this.listview.Invoke((EventHandler)delegate { listview.Items[iRowIndex].Selected = true; listview.Items[iRowIndex].Focused = true; if (iRowIndex + 20 < listview.Items.Count) { listview.Items[iRowIndex + 20].EnsureVisible(); } listview.Update(); }); iRowIndex++; Thread.Sleep(100); } }
listview.Items[iRowIndex + 20].EnsureVisible();
public CustomListView() : base() { base.OwnerDraw = true; //this.DoubleBuffered = true; SetStyle(ControlStyles.DoubleBuffer | ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); UpdateStyles(); }
virtual void OnNotifyMessage(Message m) override { //Filter out the WM_ERASEBKGND message if(m.Msg != WM_ERASEBKGND) { ListView::OnNotifyMessage(m); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)