在写 popupmanu.items.add() 时提示: add()里面是“TMenuItem”类该怎么写? 谢谢!
解决方案 »
- 求救一个组合算法倒推问题
- 如何定义16进制数组?
- 在VC++环境下怎么使用Delphi编写的DLL,
- Indy的工作机制,困惑中,希望各路英雄们指点!!! ****英雄贴****
- Database控件中DatabaseName应该填什么?
- 小弟,对这个组件不太熟,能不能介绍下用法
- 程序运行占用内存上10MB
- IB数据库图像存储与查询
- 如何实现这样的效果?
- 使用VC调用Delphi写的DLL时编译通过,也能正常运行,可相应的函数就是不执行指定的操作,好像DLL没有起做用一样
- delphi工程文件编译出错,困惑,急,在线等候,祝大家心想事成!
- 一个字段(类型为image)里存有一个report builder文件,怎样把这个报表读出来预览?
aItem:TMenuItem;
begin
aItem:=TMenuItem.Create(Self);
aItem.Parent:=PopupMenu1;
aItem.Name:='NewAdd01';
aItem.Caption:='我是新加的!';
PopupMenu1.Items.Add(aItem);
end;
大量电脑书籍下载:
http://www.netyi.net/in.asp?id=ForMoreU
aItem.Parent:=PopupMenu1;
一行去掉!
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls;type
TForm1 = class(TForm)
Button1: TButton;
PopupMenu1: TPopupMenu;
aaa1: TMenuItem;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
Procedure MyClick(Sender:TObject);
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
Var
aItem:TMenuItem;
begin
aItem:=TMenuItem.Create(Self);
aItem.Name:='NewAdd01';
aItem.Caption:='我是新加的!';
aItem.OnClick:=MyClick;
PopupMenu1.Items.Add(aItem);
end;procedure TForm1.MyClick(Sender: TObject);
begin
ShowMessage('哎哟,你点了我了!');
end;end.
mu_Menu1:Tmenuitem;
begin
mu_Menu1:=tmenuitem.Create(popupmenu1);
mu_Menu1.Caption :='ss23'; popupmenu1.Items.Add(mu_menu1);end;