Hello, Wrong number parameters specified for call to "MyPopup"
This example works in Delphi but not in Lazarus, what are parameters ? procedure TForm1.Button1Click(Sender: TObject); var MyItem,MySubItem1: TMenuItem; Num: Integer; begin Inc(Num); MyItem:=TMenuItem.Create(Self); MySubItem1:=TMenuItem.Create(Self); MyItem.Caption:='Hello'+IntToStr(Num); MySubItem1.Caption:='Good Bye'+IntToStr(Num); MainMenu1.Items.Add(MyItem); MainMenu1.Items[0].Insert(num-1,MySubItem1); MyItem.OnClick:=MyPopUp; MySubItem1.OnClick:=MyPopUp; end; procedure TForm1.MyPopup(Sender: TObject); begin with Sender as TMenuItem do ShowMessage(Caption); end; -- Binho
-- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus