hi
i have a question relating to a date time picker,
i have a form that i have the employee name and all the emaloyee details such as the employee DOB. whena user selects a user from the combo box the details from the database is being taken and displayed in the form. that thing is i have a date time picker and in the form load i have the code

dpDOB.Format = DateTimePickerFormat.Custom;
            dpDOB.CustomFormat = " ";

and in the datetime picker close up i have the code

dpDOB.Format = DateTimePickerFormat.Short;

and when it shows the data the datetime picker value does is not displayed, i have to click the datetime picker for the value to show up

how can i solve this.

thanks

Add this line:
dpDOB.Format = DateTimePickerFormat.Short;
to the code that draws the info from the database. Just place under the rest and it should work. The problem at the moment is that you only have it in the dateTimePicker code segment which is only getting called when you click on it.

Add this line:
dpDOB.Format = DateTimePickerFormat.Short;
to the code that draws the info from the database. Just place under the rest and it should work. The problem at the moment is that you only have it in the dateTimePicker code segment which is only getting called when you click on it.

thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.