ListView

  • Thread starter Thread starter Scott Toney
  • Start date Start date
S

Scott Toney

I have 2 listviews, one with a scrollbar. What is my best way to have the
one scrollbar scroll both listviews?

Thanks
Scott
 
If you send WM_VSCROLL to a listview window handle you will scroll its
vertical scrollbar. Here is a small example how it can be done:


lsitView.Capture = true;
IntPtr hwnd = GetCapture();
lsitView.Capture = false;

SendMessage(hwnd, WM_VSCROLL, SB_LINEDOWN, 0);

....


const int WM_VSCROLL = 0x115;
const int SB_LINEUP = 0;
const int SB_LINEDOWN = 1;
const int SB_PAGEUP = 2;
const int SB_PAGEDOWN = 3;


[DllImport("coredll.dll")]
extern static IntPtr GetCapture();
[DllImport("coredll.dll")]
extern static int SendMessage(IntPtr hWnd, uint Msg, int WParam, int
LParam);
 
Back
Top