Click here to Skip to main content
16,004,529 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In Date time picker when pressing F4 it popups the calendar. Is there any way to prevent to poput the calendar when pressing the F4.
Posted

1 solution

You can use the SuppressKeyPress property in the KeyDown evnt of your DateTimePicker, like this:-

C#
private void dateTimePicker1_KeyDown(object sender, KeyEventArgs e)
        {
            if(e.KeyCode == Keys.F4)
            {
                e.SuppressKeyPress = true;
            }
        }


and that will prevent F4 from working.

Hope this helps.
 
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