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.

MonthCalendarAdv does not fire keyboard events?

Thread ID:

Created:

Updated:

Platform:

Replies:

62153 Jun 8,2007 10:20 AM Jun 11,2007 10:47 AM Windows Forms 1
loading
Tags: Tools
Kamen Yotov
Asked On June 8, 2007 10:20 AM

1) I want to be able to override the key bindings of the MonthCalendarAdv control. I tried to handle KeyDown and PreviewKeyDown events, but they do not fire for me?

2) I am having a similar (although milder) problem with a ToolStripComboBox... If I handle KeyDown, it is called for most any key, but not Escape?

I am putting these controls inside a PopupContainerControl, and to the very least want to be able to hide the popup when the user presses Esc.

Thanks,
Kamen

Golda Rebecal [Syncfusion]
Replied On June 11, 2007 10:47 AM

Hi Kamen,

We can handle the KeyDown event in MonthCalendarAdv using the following code.

[Code]
this.monthCalendarAdv1.Controls[0].KeyDown += new KeyEventHandler(monthCalendarAdv1_KeyDown);

// To close the pop up on Esc key
void monthCalendarAdv1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.Escape)
if (this.popupControlContainer1.IsShowing())
this.popupControlContainer1.HidePopup(PopupCloseType.Canceled);
}

I have attached a sample that illustrates the same. Please have a look at it and let me know if this helps you.

http://websamples.syncfusion.com/samples/Tools.Windows/F62153/Main.htm

Best regards,
Golda

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.

;