is it possible to tab through the month/day/year on the DTP?
It's tough being an unhandled exception... ___________ VB.NET 2008 VB.NET 2010 ORACLE 11g CRYSTAL 11
Yes it is. VB Code: Public Class tabDTP Inherits DateTimePicker Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean If keyData = Keys.Tab Then SendKeys.Send("{RIGHT}") Return True ElseIf keyData = (Keys.Shift Or Keys.Tab) Then SendKeys.Send("{Left}") Return True Else Return MyBase.ProcessDialogKey(keyData) End If End Function End Class And where you need it in your code: VB Code: Dim myDTP as New tabDTP
Public Class tabDTP Inherits DateTimePicker Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean If keyData = Keys.Tab Then SendKeys.Send("{RIGHT}") Return True ElseIf keyData = (Keys.Shift Or Keys.Tab) Then SendKeys.Send("{Left}") Return True Else Return MyBase.ProcessDialogKey(keyData) End If End Function End Class
Dim myDTP as New tabDTP
'Heading for the automatic overload' Marillion, Brave, The Great Escape, 1994 'How will WE stand the FIRE TOMORROW?' Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
Forum Rules