Calendar and C#

  • Thread starter Thread starter reidarT
  • Start date Start date
R

reidarT

I try to get the selected date from the calendar control to a label with
this:
this.Label4.Text = this.Calendar1.SelectedDate ;

but, I get the mesage Cannot implicitly convert type 'System.DateTime to
string'
regards
reidarT
 
Hi,

Calendar1.SelectedDate is a type of System.DateTime .. try
Calendar1.SelectedDate1.ToString ();
 
You have a type mismatch: this.Calendar1.SelectedDate returns a
DateTime type and Label4.Text expects a string type.

Try:
this.Label4.Text = this.Calendar1.SelectedDate.ToString();

David Barkol
www.neudesic.com
 
Back
Top