Ver Mensaje Individual
  #1  
Antiguo 07-12-2020
LACV LACV is offline
Miembro
 
Registrado: oct 2015
Posts: 80
Reputación: 9
LACV Va por buen camino
Exclamation Menu dinamico

Buena tarde

Compañeros estoy realizando un menu dinamico pero me falta que cuando se genere y se le de clic abra un formulario
Código Delphi [-]
procedure TFrmHome.FormCreate(Sender: TObject);
var
  Item: TMenuItem;
begin
  // generamos el menu dinamico
  DModulot.ResetConf();

  with DModulo.QueryDocumentos do
  begin
    if RecordCount > 0 then
    begin
      First;
      while Eof = false do
      begin
        Item := TMenuItem.Create(Self);
        MVentas.Add(Item);

        Item.Caption := FieldByName('Documento').AsString;
        Item.ImageIndex := 1;
        Item.OnClick := menuDinamicoClick;
        Next;
      end;
    end;
  end;
end;

tengo esta funcion pero no se me ocurre como llamar el formulario
Código Delphi [-]
procedure TFrmHome.menuDinamicoClick(Sender: TObject);
begin
  if Sender is TMenuItem then
  begin
    ShowMessage('Hola');
  end;
end;

Última edición por LACV fecha: 07-12-2020 a las 21:40:48.
Responder Con Cita