troubleshooting Question

vb.net datetimepicker behavior

Avatar of PSCTECH
PSCTECH asked on
.NET ProgrammingVisual Basic.NET
14 Comments1 Solution1956 ViewsLast Modified:
I have an app that runs  on a tablet.  The virtual keyboard is a pain to use so I am trying to accomplish as much as possible by using the limited buttons (up, down, left and right arrows and Enter button) on the exterior of the tablet.

I want to allow the user to move through the controls on the form by pressing the Enter button (this is an actual button not a virtual keyboard key).  This is working fine using the KeyPress event and:
If e.KeyChar = Microsoft.VisualBasic.ChrW(Keys.Return) Then SendKeys.Send("{TAB}")
until I am moving from a textbox to a datetimepicker.  

When the datetimepicker gets focus i use
SendKeys.Send("%{DOWN}")
the calendar opens, immediately closes and the month (of the current date) which is set at form load is highlighted.

What I would like to happen is for the user to press the Enter button and the "Tab" is sent and the datetimepicker gets focus, is for the control to open and remain open until a date is chosen.

I can simulate all of this behavior on my pc.  Using the Enter Key produces the same problematic behavior.  Using the actual Tab Key produces the desired behavior.  But again the keyboard on the device is not a good option.
ASKER CERTIFIED SOLUTION
Mike Tomlinson
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
Join our community to see this answer!
Unlock 1 Answer and 14 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros