HighTechTalks DotNet Forums  

How to trap <Ctrl+Tab> is DataGridView

Dotnet Framework (WinForms Controls) microsoft.public.dotnet.framework.windowsforms.controls


Discuss How to trap <Ctrl+Tab> is DataGridView in the Dotnet Framework (WinForms Controls) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
John B.
 
Posts: n/a

Default How to trap <Ctrl+Tab> is DataGridView - 01-03-2008 , 02:40 PM






Please forgive my rant, but trapping keystrokes in .NET couldn't get much
worse if someone tried. Sorry to vent my frustration but I've had no end of
problems with this for the past 18 months. The entire system is a convoluted
mess and really needs a complete overhaul. With that off my chest, does
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.



Reply With Quote
  #2  
Old   
AMercer
 
Posts: n/a

Default RE: How to trap <Ctrl+Tab> is DataGridView - 01-03-2008 , 02:55 PM






Quote:
... does
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



Reply With Quote
  #3  
Old   
John B.
 
Posts: n/a

Default Re: How to trap <Ctrl+Tab> is DataGridView - 01-03-2008 , 03:21 PM



Quote:
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.




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.