Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2008

Tip: Looking for answers? Try searching our database.

How to trap <Ctrl+Tab> is DataGridView

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John B. - 03 Jan 2008 19:40 GMT
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.
AMercer - 03 Jan 2008 19:55 GMT
> ... 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
John B. - 03 Jan 2008 20:21 GMT
>> 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
[quoted text clipped - 10 lines]
>      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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.