Hello!
I have two ImageLists containing the same icons in 16*16 and 32*32. Now I want to change all my icons in my TTree.
I tried the code below, but there is no change to the icons! How Do I update them during runtime?
Regards, Mikael
Procedure TForm4.B_BigIconClick(Sender: TObject);
Begin
Tree.Images := TreeImageListBig; '' <- Nothing happenes here so try to reload all icons
ReloadIcons;
End;
Procedure TForm4.B_SmallIconClick(Sender: TObject);
Begin
Tree.Images := TreeImageListSmall;
ReloadIcons;
End;
Procedure TForm4.ReloadIcons;
Var I: Integer;
Begin
For I := 0 To Tree.Items.Count - 1 Do
Begin
Tree.Items.ImageListIndex := -1; '' <- Tried to reset the icon here to be able to reload it below, but it does not change
Tree.Items.ImageListIndex := Tree.Items.ImageListIndex;
Tree.Items.Repaint;
End;
End;
Switching imagelist at runtime
Re: Switching imagelist at runtime
Hi Mikael,
I think that you only need a Tree1.Draw to refresh the icons.
See the attached project.
I think that you only need a Tree1.Draw to refresh the icons.
See the attached project.
- Attachments
-
- reload_icons.zip
- (12 KiB) Downloaded 1035 times
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |