Results 1 to 2 of 2

Thread: DateTimePicker

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    DateTimePicker

    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

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    Yes it is.
    VB Code:
    1. Public Class tabDTP
    2.         Inherits DateTimePicker
    3.         Protected Overrides Function ProcessDialogKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean
    4.             If keyData = Keys.Tab Then
    5.                 SendKeys.Send("{RIGHT}")
    6.                 Return True
    7.             ElseIf keyData = (Keys.Shift Or Keys.Tab) Then
    8.                 SendKeys.Send("{Left}")
    9.                 Return True
    10.             Else
    11.                 Return MyBase.ProcessDialogKey(keyData)
    12.             End If
    13.         End Function
    14.     End Class
    And where you need it in your code:
    VB Code:
    1. 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width