Bind nullable DateTime to MaskedTextBox

后端 未结 5 1593
遇见更好的自我
遇见更好的自我 2021-01-18 05:59

I have a masked text box bound to a nullabe datetime, but when the date is blanked out, the validation on the masked text box won\'t complete. Is there a way to force this

5条回答
  •  心在旅途
    2021-01-18 06:22

    You can simply give date format as below:

    maskTextBox1.DataBindings.Add("Text", bs, "SummitDate1", true, DataSourceUpdateMode.OnPropertyChanged, null, "dd/MM/yyyy");
    

提交回复
热议问题