?
Solved

Calendar browse

Posted on 2004-10-15
5
Medium Priority
?
262 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

719 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