第二个问题,在“OnKeyPress”中加入
IF Key = #13 then Key := #0;
IF Key = #13 then Key := #0;
解决方案 »
- 请问如何让table在dbgrid中显示的数据进行排序呢
- 我欠Borland的……
- 超级难题,请问在delphi语言里跟c语言中extern 等价的词是什么?
- 请教如何判断某个键被按下???
- 有关dll的一个问题?
- 一个麻烦的问题!
- 怎样在dbgrid回车后,让当前记录行改变颜色
- 送分题:请回答:delphi中如何对 ' 进行转义,50分
- 为什么写到数据库时候,连时间也写入到数据库中???
- Delphi将一个Integer值写入磁盘文件,怎么用VC++将其正确读出?
- 如何用数组的形式来表示CommboBox中Items项?
- 大虾救我,怎样取得上网后网络的数据传输量,比如说接收到多少字节,发送了多少字节
实际上它是调用了Windows API 函数SendMessage
LRESULT SendMessage( HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
Perform的用法
Perform(Msg: UINT; wPa: WPARAM; lPa: LPARAM)
with RichEdit1 do
Begin
SelStart := StrToInt(MaskEdit1.Text);
RichEdit1.Perform(EM_SCROLLCARET, 0, 0);
end;
end;
实际上它是调用了Windows API 函数SendMessage
LRESULT SendMessage( HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
Perform的用法
Perform(Msg: UINT; wPa: WPARAM; lPa: LPARAM);回车键去掉声音可用一个TApplicationEvents控件,在其OnMessage事件中截获WM_CHAR消息,看看是否为回车,如果是则将Handled 设为True, 然后发送一个Tab键的消息.
procedure TForm1.Panel1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
const
SC_DragMove = $F012;
begin ReleaseCapture;
panel1.perform(WM_SysCommand, SC_DragMove, 0);
end;//执行以后拖panel看看^_^
if Key=#13 then
Key := #0;
Perform(WM_NEXTDLGCTL,0,0);
但每按一次回车,还会发出“嘀”的声音,而且回车键没有代替TAB键。请问是何原因?一定给分
form的同样事件,
并设好TabOrder
if Key=#13 then
Key := #0;
Perform(WM_NEXTDLGCTL,0,0);
可是就是不行(TabStop全是True,且TabOrder也设得没错。
如:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key = #13 then
begin
Key := #0;
//以下两种方法都可以啊:Perform或者PostMessage
//Edit1.Perform(WM_NEXTDLGCTL,0,0);
PostMessage(Edit1.Handle, WM_KEYDOWN, VK_TAB, 0);
//Then Edit2 得到焦点了
end;
end;
if Key=#13 then
Key := #0;
Perform(WM_NEXTDLGCTL,0,0);