Probier mal den Code:
Delphi-Quellcode:
var
i:integer;
begin
for i := 0 to Menu.Items.Count-1 do
MyMenuShowMessage(Menu.Items[i]);
end;
und zusätzlich die rekursive Prozedur:
Delphi-Quellcode:
procedure MyMenuShowMessage(myMenuItem:TMenuItem);
var i:integer;
begin
ShowMessage(myMenuItem.Caption);
for i := 0 to myMenuItem.Count-1 do
MyMenuShowMessage(myMenuItem.Items[i]);
end;
Das klappt.