在窗体中有若干控件,用鼠标选中一个后,怎样用键盘实现把它删除?
解决方案 »
- 右键菜单问题 求解ShortCut
- delphi2007的帮助文档里没有介绍object pascal的语言的学习文档,请问哪里可以得到?
- 运行动态库时提示错误:cannot debug project unless a host applitation is defined.use the Run/parameters...dilogbox.
- 很多编辑器都有打开历史记录这一项,那个菜单是怎样动态生成的?
- 急,如何判断操作系统类型,在线等待,马上给分。
- 多媒体问题,我在线,急用!!
- 现在一般都开发什么组件,能介绍一下开发组件的好书吗?谢谢
- delphi程序语句分析?
- win2000下怎么在非delphi安装时的用户能使用所有的控件?
- 关于SQLServer的问题
- 我是新人,我想接触D ,但是不知道是学习D7好还是学习D2005好~
- 急!!!小女子菜,向各位大虾请教DBGrid选择某行的问题?
怎么添加Key事件,给谁添加,往哪里加?
又或者
全部使用动态Create的组件http://lysoft.7u7.net
Button1: TButton;
Button2: TButton;
Memo1: TMemo;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
procedure ComponentKeyUp(Sender: TObject; var Key: Word;Shift: TShiftState);
end;procedure TForm1.ComponentKeyUp(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (Key=46)then
Sender.Destroy;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
Button1.OnKeyUp:=ComponentKeyUp;
Button2.OnKeyUp:=ComponentKeyUp;
Memo1.OnKeyUp:=ComponentKeyUp;
end;