trevorb
asked on
Scrolling a ListView
If I select an item in a ListView manually (i.e. via code rather than clicking) how can I scroll the ListView to make that item visible (within the viewable area)?
Cheers, Trevor.
Cheers, Trevor.
This will put item 67 at the top of the listview (if there are enough items):
with ListView1 do
begin
Items[67].Selected := true;
Scroll(0, Selected.Position.y - TopItem.Position.y);
end;
This only works with report style...
Epsylon.
with ListView1 do
begin
Items[67].Selected := true;
Scroll(0, Selected.Position.y - TopItem.Position.y);
end;
This only works with report style...
Epsylon.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
oops,
sorry eps,
didn't see your comment,
well, this may also a possibility
meikl
sorry eps,
didn't see your comment,
well, this may also a possibility
meikl
ASKER
Cheers everyone!
Trevor
Trevor
try
Listview1.ItemFocused.Make
meikl