在DBGridEh(Delphi7)里如何设置按TAB键自动跳到下一
列,当然,如果可以设置成回车能自动跳到下一列,而不
是跳出网格就更好了。
列,当然,如果可以设置成回车能自动跳到下一列,而不
是跳出网格就更好了。
解决方案 »
- ReadProcessMemory读入buffer问题
- 简单的connect问题?
- 求教一个DLL函数调用的问题
- Delphi开发,安装什么操作系统最好!请进来谈谈你的看法,来者有分,明天结贴
- 如何使TComboBox组件的文字左边出现图标?
- for help
- Delphi?
- SQL中的小问题
- 怎么在程序里面设置数据库的用户和密码
- 如何实现:当鼠标在屏幕上(并非Form上)移动时,时时获得鼠标在屏幕上的坐标?
- 怎样控制Word的菜单,我使用的Activex+WebBrowser开发的,主菜单我自定义那下拉的二级菜单,我能否从VBA中批量自动得到呢?
- 明天就是国庆,祝愿祖国繁荣富强,散分祝贺~~
procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
DBGrid1.SelectedIndex := DBGrid1.SelectedIndex + 1;
end;
不是啊,是跳到一列,那请问你怎么跳到下一列?楼主说的是按“回车”,不是“->”键。
可以这样:
procedure TForm1.DBGrid1KeyPress(Sender: TObject; var Key: Char);
begin
If Key = #13 then
If DBGrid1.SelectedIndex >= X Then
DBGrid1.SelectedIndex := 0
Else
DBGrid1.SelectedIndex := DBGrid1.SelectedIndex + 1;
end;
object.handle:是你想讓TAB去的地方。
if Key = #13 then
begin
Key := #0;
Perform (CM_DialogKey, VK_TAB, 0);
end;
MultiSelected:=False;
Tabs:=True;
有属性可以用,干吗非要写代码?
procedure TForm1.DBGrid1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState); begin
if key=$0d then
begin
if dbgrid1.SelectedIndex+1=dbgrid1.Columns.Count then
begin
table1.Next ;
dbgrid1.SelectedIndex:=0;
end
else
dbgrid1.Selectedindex:=dbgrid1.SelectedIndex+1;
end;
end;