c# - How to programatically dismiss the calendar of a DateTimePicker -


I am working on a Windows form that uses a good amount of date movie picture controls, according to the device, The administrator should not show 'any date' before manually selecting a date to the user.

According to the date picture functionality, we can specify 'nothing' as the value. So whatever we do, a minimum minimum date is set, and then change the custom format of control to give an illusion of empty field.

We have found that when a user clicks on DateTimePicker and selects a new date for the first time, its initial click does not dismiss the calendar. Therefore the calendar continues instead, and the user has to manually click outside the control to dismiss the calendar.

To make the user experience a little worse, while in this situation the calendar is immune to further date selection. Therefore, the date selection is initially associated with the date chosen, and the user has to click.

Once a date has been selected by the control, by selecting a new date the calendar is rejected as expected.

My best estimate will be to do something with a custom format that is basically what causes a hiccup with control when a new properly formatted date is selected.

While trying to find a way to run 'force' to dismiss the calendar while being open on price changes, I am not getting a way to do this. I have tried to focus somewhere else on price changes, but there is no luck either.

Has anyone else experienced this behavior and / or knows a way around it? Thanks!

Some code -----------

  // If dateTime property is not saved, call ClearDateTime on the controller, then Display the saved value from Public Static Zero ClearDateTime (DateTimePicker DTP) {dtp.Value = DateTime.Today.AddDays (-1); // format dtp.format = System.Windows.Forms.DateTimePickerFormat.Custom; set on; // Set custom format to clear DTP CustomFormat = ""; } // When the value is changed / the date is selected Private Zero DateTime Picture_Well converted (Object Sender, EventArgues E) {Manually Utility. ShodTime (This. Datetime Picture); This.LockFormDown (); } Public static Zero ShowDateTime (DateTimePicker DTP) {dtp.Format = System.Windows.Forms.DateTimePickerFormat.Long; }  

Basically you need to manually increase the closeup event, please give it here See the solution,


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -