Delphi 7: Проблема отрисовки иконок в TPopupMenu связанного с TActionList и TImageList

Jun 15, 2011 11:39

Имеем на входе:
  • ActionList1: TActionList
  • ImageList1: TImah\geList
  • PopupMenu1: TPopupMenu
Псевдокод
ActionList1.Images = ImageList1;

ActionList1.Actions[0].Image = ImageList1.#0;
ActionList1.Actions[1].Image = ImageList1.#1;

PopupMenu1.Images = ImageList1;
PopupMenu1.Item[0].Action = ActionList1.Actions[0];
PopupMenu1.Item[1].Action = ActionList1.Actions[1];

Проблема
Если в ActionList1
ActionList1.Actions[0].Enabled = False;
ActionList1.Actions[1].Enabled = False;
, то при запуске в выпадающем меню иконки не рисуются, даже если программно делать Enable.

Однако если
ActionList1.Actions[0].Enabled = True;
ActionList1.Actions[1].Enabled = True;
все отбражается как надо.

технические заметки, delphi, работа

Previous post Next post
Up