-
[Apologies for the double post, but this is a matter of some urgency]
I just created my first DBGrid (yaaah!) but I'm having trouble moving from column to column. I tried TAB, but that just moves to the next control, and <RET> just activates the default button.
So, without using the mouse, how do I get to the next column? And back?
-
Set Focus
This is just a suggestion. Can't you catch the key event for the tab key and then just set the grid to the next column.Keep track of where the column was at last. In a var. That is the only idea i can think of. I will try to find out for you.
-
jjortiz, in a fit of perceived brilliance last night, I tried that. I have the following in DBGrid KeyDown event
Code:
If KeyCode = 9 Then
DBGrid1.Col = DBGrid1.Col + 1
End If
It gets there, and increments the .Col property, but it still uses the default event of pressing the Tab Key, which is "go to the next control". Is there any way of telling it not to do this? In VFP, you can use NODEFAULT to override certain system functions.
-
Code:
If KeyCode = 9 Then
DBGrid1.Col = DBGrid1.Col + 1
End If
Try something like this:
Code:
If KeyCode = 9 Then
KeyCode = 0
DBGrid1.Col = DBGrid1.Col + 1
End If
-
Worked like a charm. You da man :cool
Thanks.
-
Yeah when you set the keycode to something else it performs that action like keycode = 0 then it cancels it. There is no keycode 0. You are welcome. And thanks for that you are the man. Makes me feel that i have chosen the right path.