c'est ce que je fais,C# .Net problème DateTimePicker
//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);
}
}
Quelqu'un peut-il expliquer s'il vous plaît ce qui est la différence et pourquoi il ne marche pas changer la date avec la méthode précédente? et pourquoi il se fixe avec la dernière méthode?