>> anyone know how to trap <Ctrl+Tab> while in edit mode in a "DataGridView"
>> ("TextBox") cell. I'd certainly appreciate the info since I've pounded
>> away
>> at this for hours now and nothing seems to work. Thanks in advance.
>
>
> I think the best way is with PreviewKeyDown -
>
> Private Sub DataGridView1_PreviewKeyDown(ByVal sender As Object, ByVal e
> As System.Windows.Forms.PreviewKeyDownEventArgs) _
> Handles DataGridView1.PreviewKeyDown
> If e.Control And e.KeyCode = Keys.Tab Then
> Beep()
> End If
> End Sub
Thanks very much! That actually works when when I put it in my "TextBox"
derivative. Unfortunately, there's a bewildering number of keystroke
functions in .NET and various properties that affect it. Frequently these
functions aren't even called depending on the keystroke, control, etc.. The
situation becomes much worse when dealing with a "DataGridView" in
particular since you now have the parent form (object) itself, the
"DataGridView" object, "DataGridViewCell" objects, and the underlying
editing control objects. The number of permutations involved with all the
possible keystrokes functions, properties, special keystrokes, etc. is
mind-numbing. Coupled with documentation that's very weak, it's frequently
very difficult to accomplish even the most basic tasks. In any case, your
help was greatly appreciated. Thanks again.
|