PopupMenu的问题 最好希望有源代码写出来,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 20分太少了。所谓动态即在程序中用语句来改变一些值。 我明白是用改变,可是怎么改变阿?问题解决后分数好说! 不会的近来给提前一下也行啊 既然你都這么說了,那就幫你頂一下吧 谢谢,有钱捧个钱场,没钱的捧个人场,大家给带你面子,关照一下阿 有钱帮你捧个钱场,没钱帮你捧个人场!都没有,算了,帮你up一下吧! 老兄不会是想做书签吧?这点分一般没人来啊。问题不难,自己写吧! 明白你意思,本人没有这样的代码,帮助你up************* 努力学习 ** 全为 **¥人民币¥************* 兄弟,还没有答案?算了,再帮你UP! unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Menus, StdCtrls;type TForm1 = class(TForm) Edit1: TEdit; PopupMenu1: TPopupMenu; jljkl1: TMenuItem; Edit2: TEdit; procedure FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } procedure myclick(Sender: TObject); public { Public declarations } procedure additems ; end;var Form1: TForm1; list : TStrings ;implementation{$R *.DFM}procedure TForm1.additems;var i : Integer ; items : TMenuItem ;begin PopupMenu1.items.Clear ; for I := 0 to list.count-1 do begin items := TMenuItem.Create (PopupMenu1) ; items.Caption := list[i]; items.tag := i ; items.OnClick := myclick ; PopupMenu1.Items.Add (items); end ;end;procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); var p : Tpoint ;begin if ssRight in shift then begin additems ; GetCursorPos(p); PopupMenu1.Popup (p.x,p.y) end ;end;procedure TForm1.myclick(Sender: TObject);begin with sender as TMenuItem do begin edit1.Text := list[tag]; edit2.text := caption ; end ;end;procedure TForm1.FormCreate(Sender: TObject);begin list := Tstringlist.Create ; list.LoadFromFile ('c:\temp.txt');end;procedure TForm1.FormDestroy(Sender: TObject);begin list.free;end;end.以上的代码对你可能有帮助。你要做的就是将连接一一对应而已 用oraquery查询数据,想设置查询进度条? Socket一对多连接 关于cursorlocation的问题。 一个关于在图像中运用鼠标拖拉的问题?(急!!!) 轻松回答 为什么我编译好的客户端执行文件,拿到没有装bcb的机器上执行就报需要什么bpl文件,这是怎么回事啊? stringgrid 用法 急:delphi打印的问题:每次联机后必须先用别的软件打印一次,delphi程序才能正常打印 急死人了!!!打包老是搞不好!!! 如何定制自己的Form,从New Component中? DBLookupComboBox的使用 求救!!!可加到200分,只希望能够解释得清楚,
* 努力学习 *
* 全为 *
*¥人民币¥*
************
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, StdCtrls;type
TForm1 = class(TForm)
Edit1: TEdit;
PopupMenu1: TPopupMenu;
jljkl1: TMenuItem;
Edit2: TEdit;
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
{ Private declarations }
procedure myclick(Sender: TObject);
public
{ Public declarations }
procedure additems ;
end;var
Form1: TForm1;
list : TStrings ;
implementation{$R *.DFM}procedure TForm1.additems;
var i : Integer ;
items : TMenuItem ;
begin
PopupMenu1.items.Clear ;
for I := 0 to list.count-1 do
begin
items := TMenuItem.Create (PopupMenu1) ;
items.Caption := list[i];
items.tag := i ;
items.OnClick := myclick ;
PopupMenu1.Items.Add (items); end ;
end;procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
p : Tpoint ;
begin
if ssRight in shift then
begin
additems ;
GetCursorPos(p);
PopupMenu1.Popup (p.x,p.y)
end ;
end;procedure TForm1.myclick(Sender: TObject);
begin
with sender as TMenuItem do
begin
edit1.Text := list[tag];
edit2.text := caption ;
end ;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
list := Tstringlist.Create ;
list.LoadFromFile ('c:\temp.txt');end;procedure TForm1.FormDestroy(Sender: TObject);
begin
list.free;
end;end.
以上的代码对你可能有帮助。你要做的就是将连接一一对应而已