Board index » delphi » Adding menu items dynamically?

Adding menu items dynamically?

Hi!

How would I add menu items dynamically to the systems menu of a form?

Cheers

Johan

 

Re:Adding menu items dynamically?


Johan Lindquist <jl...@students.stir.ac.uk> skrev i inl?gg
<5eulpg$...@lorne.stir.ac.uk>...

Quote
> Hi!

> How would I add menu items dynamically to the systems menu of a form?

> Cheers

> Johan

nuqneH Johan!

Maybe this code will solve your problem!

type
  TfmCommandCenter = class(TForm)
    mnComcenter: TMainMenu;
    miRegister: TMenuItem;

procedure.....
var m:TMenuItem;
    s:TmItem;
begin
               m:=TMenuItem.create(miRegister);
               m.caption:='Hello world';
               m.onClick:=miRegisterClick;      ///// The name of the
eventhandler which should be executed                                   when the user chooses, the item.
               miRegister.add(m);
end;

christ...@spocksystems.se
We live long and prosper....

Other Threads