PC Review


Reply
Thread Tools Rate Thread

How to trap <Ctrl+Tab> is DataGridView

 
 
John B.
Guest
Posts: n/a
 
      3rd Jan 2008
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
 
 
 
 
AMercer
Guest
Posts: n/a
 
      3rd Jan 2008
> ... 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
 
John B.
Guest
Posts: n/a
 
      3rd Jan 2008
>> 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
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Trap ctrl+Break Office_Novice Microsoft Excel Programming 6 19th Jul 2009 06:02 PM
How do I trap and/or replace the Enter key within the DataGridView B. Chernick Microsoft Dot NET Framework Forms 1 9th Oct 2008 05:28 PM
How to trap <Ctrl+Tab> is DataGridView John B. Microsoft C# .NET 2 3rd Jan 2008 09:21 PM
Copy and Paste in a DataGridView with Ctrl-C and Ctrl-V neil.stuart@gmail.com Microsoft Dot NET Framework Forms 0 31st Aug 2006 02:27 AM
Trap CTRL ALT DEL sequence =?Utf-8?B?RGF2aWRKYW1lcw==?= Microsoft Access Security 1 18th Nov 2004 06:18 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:06 AM.