TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
simon taylor
NA
38
69.1k
trouble with my calender form
Dec 9 2010 1:19 PM
Hi, i am new to c# and i am trying to develop a form to display the calander which works fine. I am trying to make it so that when the user selects any date from my MonthCalander control, it is then displayed in a messasge box. The trouble i'm having is that it no matter which date i select, it displays by default, todays date(the current todays date). Here is my code snippet:
public partial class newcontractform : Form
{
System.Data.OleDb.OleDbConnection con;
private string projectName;
private DateTime startDate;
public newcontractform()
{
InitializeComponent();
projectName = nametxtbx.Text;
monthCalendar1.MaxSelectionCount = 1;
startDate = monthCalendar1.SelectionStart;
}
private void submitbtn_Click(object sender, EventArgs e)
{
MessageBox.Show("start date is: " + startDate.ToShortDateString());
this.Close();
}
Reply
Answers (
4
)
Odd null reference from Type.GetProperty(string) method
C# syntax - what does <> mean?