We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

DateTimePickerAdv question

Thread ID:

Created:

Updated:

Platform:

Replies:

62154 Jun 8,2007 10:23 AM Jun 8,2007 08:28 PM Windows Forms 1
loading
Tags: Tools
Kamen Yotov
Asked On June 8, 2007 10:23 AM

In DateTimePickerAdv, one can use the arrow keys to go through the fields (Left+Right) and change them (Up+Down).

When I am on the date field, I want to move to the month (next field) if a letter is pressed, as this is most likely what the user means (he/she wants to type in the month, after typing in the date).

I am using CustomFormat, "dd MMM yyyy".

Is there a way to programatically check which field is one on and to move to a specific other field?

Murugan [Syncfusion]
Replied On June 8, 2007 08:28 PM

Hi Kamen,

This could be achieved by customizing the DateTimePickerAdv control and overriding the ProcessCmdKey method

[Code]
public class CustomDTPA : DateTimePickerAdv
{

public CustomDTPA(): base()
{
this.Format = DateTimePickerFormat.Custom;
this.CustomFormat = "dd mm yyyy";
}

protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
if (keyData == Keys.A)
{
keyData = Keys.Right;
}
return base.ProcessCmdKey(ref msg, keyData);
}
}

Please refer to the code snippet above and let me know if it helps you.

Thank you for your interest in Syncfusion products.

Regards,
Murugan P.S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;