Ray,
You can use you can send the LVM_SCROLL message to the listview to tell
it to scroll. Here is some of what you'll need.
http://msdn.microsoft.com/library/d...orm/commctls/listview/messages/lvm_scroll.asp
public enum ListViewMessages : int
{
LVM_FIRST = 0x1000,
LVM_SCROLL = (LVM_FIRST + 20)
}
[DllImport("User32", CharSet=CharSet.Auto)]
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int
wParam, int lParam);
private void ScrollToEnd(int width)
{
// You'll have to figure out the width in pixels. I didn't have time.
SendMessage(this.listView1.Handle, (int)ListViewMessages.LVM_SCROLL,
width, 0);
}
Jason Newell, MCAD
Software Engineer
I know that I can use ensurevisible to move to a specific item(row) in list
view. How about moving to some specific columns? Because I want to focus last
column when I add one in the listview which is autoscroll = true.
Thanks for your help
Ray