views:

84

answers:

1

How can a Windows Forms ListView be programmically scrolled left/right?

Maybe a SendMessage can be sent to the control's horizontal scrollbar?

+2  A: 

Try This

[DllImport("user32")]
static extern IntPtr SendMessage(IntPtr Handle, Int32 msg, IntPtr wParam,
IntPtr lParam);

protected void ScrollH(int pixelsToScroll)
{
const Int32 LVM_FIRST = 0x1000;
const Int32 LVM_SCROLL = LVM_FIRST + 20;
SendMessage(lvwList.Handle, LVM_SCROLL, (IntPtr) pixelsToScroll,
IntPtr.Zero);
}
JamesMLV
Worked like a charm. Thanks James!
Gerhard Weiss