{*******************************************************}
{                                                       }
{       命令模式的简化                                  }
{                                                       }
{       版权所有 (C) 2008 陈新光                        }
{                                                       }
{*******************************************************}

...
type
  TFormHycx = class(TFormMdi)
  private
    procedure MenuItemClick(sender:TObject);
  end;
...
procedure TFormHycx.FormCreate(Sender: TObject);
var
  i:Integer;
begin
  inherited;
  for i:=0 to PopupMenu.Items.Count-1 do
    PopupMenu.Items[i].OnClick:=MenuItemClick;
end;
...
procedure TFormHycx.MenuItemClick(sender: TObject);
begin
  case TMenuItem(sender).Tag of
    100:ShowGridColEditorA(TDBGridEh(ActiveControl));
    101:FindPublicShowA(TDBGridEh(ActiveControl).DataSource.DataSet);
    102:ShowFilterFormA(TDBGridEh(ActiveControl).DataSource.DataSet);
    103:ShowGroupA(TDBGridEh(ActiveControl));
    104:ExpDbgridEhA(TDBGridEh(ActiveControl));
    105:PrntA(TDBGridEh(ActiveControl),self);
  end;
end;  

相关文章:

  • 2021-04-29
  • 2021-09-07
  • 2022-12-23
  • 2022-01-17
  • 2021-06-28
  • 2021-08-05
  • 2021-11-22
  • 2021-07-19
猜你喜欢
  • 2021-11-02
  • 2021-08-01
  • 2022-01-17
  • 2021-11-16
  • 2021-10-11
  • 2021-07-07
相关资源
相似解决方案