While not NaviT.EOF do begin m := TMenuItem.create(navidummy); II:=II+1; with m do begin name :='MM'+IntToStr(II); caption := NaviT.Fieldbyname('MyWHAT').AsString ; tag := NaviT.Fieldbyname('MyTAG').AsInteger; visible:=True; OnClick:= NaviExec ; end; MyMenuItem.add(m); NaviT.Next; end; NaviT.Close; end;
procedure TMyForm.NaviExec(Sender:TObject); begin
What.text := (Sender as TMenuItem).Caption; { Здесь я получаю то, что хочу ! } Key:= (Sender as TMenuItem).Tag ; end;