Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
Jmich
Posted - Feb 07 2024 : 16:05:33 Here's my code: But this does not work! Who has a solution or idea.
var
i: Integer;
begin
if (listbox1.ItemIndex < > -1) and (listbox1.ItemIndex < ImageEnVect1.ObjectsCount) then
begin
for i: = 0 to ImageEnVect1.ObjectsCount - 1 do
begin
if (ImageEnVect1.ObjText [i] = '' + listbox1.Items [listbox1.ItemIndex] + '') then
begin
ImageEnVect1.SelObjects [i];
Exit;
end;
end;
end;
end;
jm
4 L A T E S T R E P L I E S (Newest First)
Jmich
Posted - Feb 09 2024 : 10:53:44 Thanks for the help ! Works great !
best greetings Jmich
jm
xequte
Posted - Feb 08 2024 : 19:26:04 How about:
procedure TForm2.Listbox1Click(Sender: TObject);
var
index: Integer;
begin
ImageEnVect1.UnSelAllObjects();
if Listbox1.ItemIndex > -1 then
begin
Index := Listbox1.ItemIndex;
ImageEnVect1.AddSelObject( ImageEnVect1.GetObjFromIndex( index ));
label1.Caption: = IntToStr( index );
end;
end;