this is what I am doing,
//this doesnt set the datetimepicker value to the set value
class{
constructor
{
InitializeComponent(); // -> this initializes all the form components
DateTimePicker.Value = System.DateTime.Now.AddDays(30); //->trying to set the date time picker value to a date one month from now.
}
}
//but this does set the date to the desired value..
class{
constructor
{
InitializeComponent(); // -> this initializes all the form components
}
form_onLoad() //->on form load event
{
DateTimePicker.Value = System.DateTime.Now.AddDays(30);
}
}
Can someone please explain whats the difference and why it doesnt change date with previous method? and why it sets with the latter method?