Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Calendar browse

Posted on 2004-10-15
5
Medium Priority
?
268 Views
Last Modified: 2010-04-15
Hi Experts,

I would implement the following :

When calendar pops up I would

1  enable month / year back forward scrolling using left / right arrows on keyboard
2  enable when Escape key is pressed to close calendar

Thank you.
0
Comment
Question by:fpoyavo
  • 2
  • 2
5 Comments
 
LVL 8

Expert Comment

by:tomvergote
ID: 12321244
What tech are you using? winforms or webforms?
there are rudimentary standard ones included with the framework
ASP .NET
http://samples.gotdotnet.com/quickstart/aspplus/samples/webforms/ctrlref/webctrl/calendar/doc_cal.aspx

winforms:
look for monthcalendar here:
http://samples.gotdotnet.com/quickstart/winforms/doc/WinFormsSamples.aspx
but you need to install the sdk to view it

both can be dropped on a form from the toolbox
0
 
LVL 1

Author Comment

by:fpoyavo
ID: 12321709
The question is how do I accomplish

1  enable month / year back forward scrolling using left / right arrows on keyboard
2  enable when Escape key is pressed to close calendar

0
 
LVL 8

Expert Comment

by:tomvergote
ID: 12323687
euh, client side javascript, has nothing to do with c#
0
 
LVL 3

Accepted Solution

by:
aacool earned 2000 total points
ID: 12324112
You can use the System.Windows.Forms.MonthCalendar Control or the DateTimePicker control
The MonthCalendar Control automatically handles left/right arrow effects.
To navigate one month at  a time when using the left/right arrows, set

      this.monthCalendar1.ScrollChange = 1;

Assuming you have the calendar control pop up as a dialog, you need to handle the KeyUp event in your form code. You can choose to do this either at the form level or at the calendar control level.

To handle keyboard events only at the form level and not allow other controls to receive keyboard events, set the KeyPressEventArgs.Handled property in your form's KeyPress event-handling method to true.

In the relevant KeyUp method event handler,

private void monthCalendar1_KeyUp(object sender, System.Windows.Forms.KeyEventArgs e)
{
      switch(e.KeyCode)
      {
            case Keys.Right:
                  //increment displayed range by one month or other amt as needed
                                                break;
                                case Keys.Left:
                                               //decrement displayed range by one month
                                                break;
                                case Keys.Escape:
                                               // close popup window on escape
                                               this.Close();
                                               break;
      }
}


0
 
LVL 3

Expert Comment

by:aacool
ID: 12352378
Did this work out for you?
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Screencast - Getting to Know the Pipeline

782 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question