Thanks
Tom Groszko
You could try scrolling the item into view with EnsureVisible(), then use
GetColumnWidth() to add up the widths of the columns up to the column you
want, then use Scroll() to scroll it across the desired amount.
--
Andy Hassall (an...@andyh.org) icq(5747695) http://www.andyh.org
http://www.andyh.uklinux.net/space - disk usage analysis tool
CListCtrl & ListCtrl = GetListCtrl();
ListCtrl.EnsureVisible(item, FALSE);
int ColumnIndex;
int StartColPosition = 0;
for (ColumnIndex = 0; ColumnIndex < column; ++ColumnIndex)
{ StartColPosition += ListCtrl.GetColumnWidth(ColumnIndex);
}
int CurrentScrollPosition = ListCtrl.GetScrollPos(SB_HORZ);
CSize ScrollAmount(StartColPosition - CurrentScrollPosition, 0);
ListCtrl.Scroll(ScrollAmount);
"Andy Hassall" <an...@andyh.org> wrote in message
news:7iq62todauqas81rq...@4ax.com...
CListCtrl & ListCtrl = GetListCtrl();
CRect ItemRectangle;
ListCtrl.GetSubItemRect(item, column, LVIR_BOUNDS, ItemRectangle);
ListCtrl.Scroll(CSize( ItemRectangle.left,
ItemRectangle.top - 2*(ItemRectangle.bottom - ItemRectangle.top)));
GetSubItemRect is documented to return the rect of the subitem however it
seems to return
a rect relative to some current scroll position because when I want a
subitem prior to the
current scroll I can get negative xy values?????
"Tom Groszko" <gros...@rapistan.com> wrote in message
news:#03I1mVW...@cppssbbsa02.microsoft.com...