c++Builder不会
Delphi的倒有一个
procedure TFormScatTaxMain.RefreshMenu;
var
TempMenu: TMenuItem;
begin
with ADOQueryPublic do
begin
Close;
SQL.Clear;
SQL.Add('select MenuID,MenuName from CustomMenus');
Open;
while not EOF do
begin
TempMenu:=TMenuItem.Create(MenuParentMenu);
TempMenu.Caption:=FieldByName('MenuName').AsString;
TempMenu.Tag:=FieldByName('MenuID').AsInteger;
TempMenu.OnClick:=ActionMenuExecute;
MenuCustomReports.Add(TempMenu);
Next;
end;
end;
end;
其余的就不用说了吧,看得懂吧?