Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I have a Datetime picker on my form and i want that when the form is loaded the calendar should not be shown only the months and years should be shown on the picker and the user should be able to only select month and year not the individual dates.

Thanks,
Tushar.
Posted

1 solution

C#
private void test_Load(object sender, EventArgs e)
        {
            dateTimePicker1.Format = DateTimePickerFormat.Custom;
            dateTimePicker1.CustomFormat = "MMMM ,yyyy";
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900