你知道什么是“当当当当当当当”吗?当当当当当当当就是“Only you .......”
不要在OnKeyDown中进行控制,在OnKeyPress中试试,呵呵
不要在OnKeyDown中进行控制,在OnKeyPress中试试,呵呵
解决方案 »
- 遇到瓶劲了.我该怎么学下去
- 对Adodataset.Recordset直接赋值报错:Field '' has no dataset
- 深夜很着急,问下DELPHI 调用C中的一个DLL,老是出现Invalid pointer operation提示,痛苦啊
- 分解之后的数据如何保存到数据库中???
- 在线等各位大侠了,我快疯了数据集无法返回!1
- 关于过程的问题
- chm文件的格式是怎样的?在delphi中如何实现编译html文件成chm文件
- 什么控件里能放几个Icon?
- 在注册表中修改一确定键的键值,用哪几条语句或控件
- 3d模型实现人工智能建立
- 关于Socket的错误:协议家族尚未配置到系统中或没有它的存在迹象(10049).为什么?
- 一个关于SQL_Server数据库异常捕获的问题!非高手勿访!
procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char);
begin
if key = #13 then key := #0;
end;
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
ACtrl: TWinControl;
k: TKeyPressEvent;
begin
if key = 13 then
begin
ACtrl := ActiveControl;
if ACtrl is TCustomMemo then exit;
if ACtrl is TEdit then
begin
if assigned(TEdit(ACtrl).onKeyPress) then
k:= TEdit(ACtrl).OnKeyPress;
TEdit(ACtrl).OnKeyPress := EditKeyPress;
end;
repeat
ACtrl:= FindNextControl(ACtrl,true,true,false);
until (ACtrl is TCustomEdit) or
(ACtrl is TCustomComboBox) or
(ACtrl is TCustomListBox) or
(ACtrl is TCustomCheckBox) or
(ACtrl is TRadioButton);
if ACtrl is TEdit then
begin
if assigned(K) then
TEdit(ACtrl).OnKeyPress := K;
end;
ACtrl.SetFocus ;
end;
end;
这句事什么意思 ?EditKeyPress哪里来的?
procedure TForm1.EditKeyPress(Sender: TObject; var Key: Char);
这么大竟然没有看见???