Jump to content

ADD an Item in a UniMMenu runtime


eugeniocel

Recommended Posts

  • 2 weeks later...

Hi,

Here is how to add UniMenuItem in a TUniPopupMenu.

 

UniPopupMenu1: TUniPopupMenu;
newCaption1: TUniMenuItem; 
.
.
procedure TMainForm.FillMenu;
var
 sTxt  : string;
 iTag  : LongInt;
 MI_New : TUniMenuItem;
begin
 For iTag := 1 to 5 do
 begin
  sTxt := 'Menu No ' + IntToStr(iTag);
  Try
   MI_New    := TUniMenuItem.Create(newCaption1);
   with MI_New do
   begin
    Caption := sTxt;
    Tag     := iTag;
   end;
  newCaption1.Add(MI_New); 
  Finally
  End;
 end;
end;

 

Link to comment
Share on other sites

×
×
  • Create New...