用左右箭头怎样实现DBGrid的水平滚动事件?
怎样才能使我按下左右箭头时,实现DBGrid的水平滚动事件?
问题点数:50、回复次数:8Top
1 楼slhog(三公子)回复于 2003-06-01 15:40:06 得分 0
用第三方控件:EHLIB3Top
2 楼wycg_cnh20(发奋图强中)回复于 2003-06-02 13:51:34 得分 0
DbGrid本来就可以实现嘛,只不过你编辑完当前的单元时,你应该敲一下Enter,再按左右键。Top
3 楼windwather(流年似水)回复于 2003-06-02 14:10:14 得分 50
在dbgrid中的keydown事件中加入面代码可以实现,不过dbgrid中必须要有实现水平移动的条件:
if Key = VK_left then
SendMessage(dbgrid1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_LINELEFT, { Scroll Command }
0) { Not Used }
else if Key = VK_right then
SendMessage(dbgrid1.Handle, { HWND of the Memo Control }
WM_VSCROLL, { Windows Message }
SB_LINERIGHT, { Scroll Command }
0); { Not Used }Top
4 楼windwather(流年似水)回复于 2003-06-02 14:10:56 得分 0
刚试过,可以实现的。Top
5 楼fhuibo(永远深爱一个叫“莎”的好女孩儿)回复于 2003-06-02 14:34:28 得分 0
studyTop
6 楼airlenllq(云上行)回复于 2003-06-02 21:17:24 得分 0
to windwather :
谢谢你的帮助,但你给我的是上下移动的,不过我知道怎么用了,
而且,只能左右移动一次,再按左右箭头时就上下移动了,能不能再解释一下谢谢!
不过,你得教我怎样给你加分,而不结贴;
Top
7 楼airlenllq(云上行)回复于 2003-06-02 21:24:49 得分 0
to windwather :
我已经解决了,谢谢,:)Top
8 楼airlenllq(云上行)回复于 2003-06-02 21:25:36 得分 0
给分
Top




