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

x
?
Solved

How to Capture the Value of the Date Clicked on on a MonthCalender Control in a DateTime Variable By Clicking on Date

Posted on 2011-02-22
2
Medium Priority
?
537 Views
Last Modified: 2013-11-26
I have a MonthCalendar Control ( named MonthCalendar1 ) on a Form1 in a Visual Basic Project in  Visual Studio 2008. I would like to capture the Value of the Date I click on this MonthCalender1 control in a DateTime  Variable  named  myDate.
I would appreciate help with code that would achieve this for me. Please also let me know in which event of this MonthCalendar Control I should put this code. Thank you for your help in anticipation.

0
Comment
Question by:FaheemAhmadGul
2 Comments
 
LVL 9

Accepted Solution

by:
Misbah earned 400 total points
ID: 34955795
Use DataChanged Event:
 

private void monthCalendar1_DateChanged(object sender, DateRangeEventArgs e)
{
     DateTime selectedDate = e.Start;
        
}

Open in new window

0
 
LVL 1

Author Closing Comment

by:FaheemAhmadGul
ID: 34955848
Many thanks. I am very grateful. Regards
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
THe viewer will learn how to use NetBeans IDE 8.0 for Windows to perform CRUD operations on a MySql database.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

885 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