Einzelnen Beitrag anzeigen

question

Registriert seit: 17. Apr 2013
97 Beiträge
 
#5

AW: runtime popupmenu on specific TDBGrid cell

  Alt 25. Sep 2013, 08:05
several Grids from several Forms will show the same popupmenu,therefore i have used the following procedure and if i can this procedure in every form on show event handler then it creates the popupmenu but the problem is, it creates the popupmenu in every cell of the Grids,but i want to check specific Grid cell to show popupmenu on specific Grid cell.
Code:
procedure TForm1.NewPopMenu(Sender:TObject);
begin
if (Sender is TDBGrid) then
        begin
          NewPopup := TPopupMenu.(TDBGrid(Sender));
          MenuItem := TMenuItem.Create(TDBGrid(Sender));
          MenuItem.Caption := 'Send-Click';
          MenuItem.OnClick := NextSection;
          TDBGrid(Sender).PopupMenu.Items.Add(MenuItem);
end;
if i call this function in every Form OnShow event then it creates the popupmenu in every Form but how can i check the value of Grid cell so that popupmenu appear only on specific cell?
  Mit Zitat antworten Zitat