Link to home
Start Free TrialLog in
Avatar of plambrec
plambrec

asked on

Placing Icons in a ListView at a specific point.

Hi,
I'm trying to put an Item into a TListView at certain coordinates X and Y given by a OnDragDrop event.
I'm using this piece of code for it :
procedure TForm1.ListView1DragDrop(Sender, Source: TObject; X, Y: Integer);
var ListItem: TListItem;
begin
  ListItem := ListView1.Items.Add;
  ListItem.Caption := TSpeedButton(Source).caption;
  ListItem.Top:=Y;
  ListItem.Left:=X;
End;
The problem now is that the caption alwas gets on top or on the left of my TListView. I'v tried to set IconsOptions.AutoArange to False or True, it won't matter..

Anyone that can help me ??

Thx

Pieter
Avatar of dwwang
dwwang

I think set AutoArrange to false only takes effects when it is in LargeIcons, in other status of listview, the icon will be at top-left at anytime.
Yes, dwwang is right. But I think it should work in "vsIcon" and in "vsSmallIcon"...

Regards, Madshi.
Avatar of plambrec

ASKER

nope, sorry, i tried both icons and smallicons style (without an actual icon, just a caption). It won't work...
I've downloaded a component called ExtListView which is an extended listview. this might work....


ASKER CERTIFIED SOLUTION
Avatar of dwwang
dwwang

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial