Force TDateTimePicker to drop down

Unfortunately there’s no message to send to TDateTimePicker which would cause it to drop down the calendar. Since the picker is designed to drop down by pressing either F4 or Alt-Down arrow, one can mimic the keypress and get the desired result with the following code:

  ...
  DateTimePicker1.Perform(WM_KEYDOWN, VK_F4, 0);
  DateTimePicker1.Perform(WM_KEYUP, VK_F4, 0);
  ...
Advertisements
Explore posts in the same categories: datetimepicker, delphi

2 Comments on “Force TDateTimePicker to drop down”

  1. 4talesa Says:

    I use this and aprove it 😉

  2. evon Says:

    SendMessage(DateTimePicker1.Handle,WM_SYSKEYDOWN,VK_DOWN, 0);


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: