2010. január 24., vasárnap

Merge two menus


Problem/Question/Abstract:

I would like to merge one menu into another. Is there an easy way to do this?

Answer:

Something like this. If you don't want to delete the item from PopupMenu2, you'll have to create a new item.

{ ... }
var
  Item: TMenuItem;
begin
  with PopupMenu2.Items do
    while Count <> 0 do
    begin
      Item := Items[0];
      Delete(0);
      PopupMenu1.Items.Add(Item);
    end;

Nincsenek megjegyzések:

Megjegyzés küldése