B benlei Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-01 #2 DBGrid1.Perform(WM_MOUSELBUTTONDOWN,0,0) then DBGrid1.Perform(WM_MOUSELBUTTONUP,0,0)
Y yzhshi Unregistered / Unconfirmed GUEST, unregistred user! 2001-12-01 #3 对楼上的补充。 在DBGrid的KeyPress时间中判断。 if Key=#13 then begin DBGrid1.Perform(WM_MOUSELBUTTONDOWN,0,0) DBGrid1.Perform(WM_MOUSELBUTTONUP,0,0) end;
对楼上的补充。 在DBGrid的KeyPress时间中判断。 if Key=#13 then begin DBGrid1.Perform(WM_MOUSELBUTTONDOWN,0,0) DBGrid1.Perform(WM_MOUSELBUTTONUP,0,0) end;
C cozo Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-02 #5 两位能解释一下这两句是什么意思吗? DBGrid1.Perform(WM_MOUSELBUTTONDOWN,0,0) DBGrid1.Perform(WM_MOUSELBUTTONUP,0,0)
L lukejee Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-06 #7 向DBGrid发送鼠标消息 WM_MOUSELBUTTONDOWN 是左键按下 WM_MOUSELBUTTONUP 是左键释放 两次操作完成一次Click,
L lukejee Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-06 #8 也可以这样写 procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char); begin if Key = Char(VK_RETURN) then begin mouse_event(MOUSEEVENTF_LEFTDOWN,0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); end; end;
也可以这样写 procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char); begin if Key = Char(VK_RETURN) then begin mouse_event(MOUSEEVENTF_LEFTDOWN,0, 0, 0, 0); mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0); end; end;
M mirik joyce Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-06 #9 在回车事件处理过程中这样写 if key = vk_return then dbgrid1.onclick(sender:tobject); 就是在这个过程中调用ONCLICK过程;
M mirik joyce Unregistered / Unconfirmed GUEST, unregistred user! 2002-01-06 #10 在一个FORM 里面 procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if key=vk_return then FormClick(Sender); end;
在一个FORM 里面 procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin if key=vk_return then FormClick(Sender); end;
P pengjinlongex Unregistered / Unconfirmed GUEST, unregistred user! 2002-10-12 #12 to lukejee 你的if Key = Char(VK_RETURN) then 可能不对,VK_XXX定义的一组常量 好象与ASCII码不对应,你试试