Link to home
Start Free TrialLog in
Avatar of efz
efzFlag for United States of America

asked on

Sizing the TDateTimePicker Component

I'm using the TDateTimePicker that is supplied with Delphi as one of the Win32 components. I've noticed that when one clicks on the drop-down button, the size of the calendar is rather large. I looked for a way to adjust the size of the calendar and couldn't find a property for that purpose. The font size property only governs the text in the box and has no apparent bearing on the size of the calendar. In fact, the only thing I can see that you can set with respect to the calendar are the colors. Is there a way I can reduce the size of the calendar drop down? It looks cartoonish and abnormal.
Avatar of jimyX
jimyX

I think it's all about the font size as the width of the drop down window is determined by the size of the font.
You can test changing the size first to a big size and then set it to a smaller size and you will notice the window is having the size that is enough to accommodate the days.

For smaller font size you can try the Font "MS Serif" with size "7" or "Terminal" with "5".
Avatar of efz

ASKER

Unless I'm misunderstanding you or not finding the correct Font property, changing the font has nothing to do with how large the drop down calendar is. The font property only seems to govern the text in the display box only. Am I missing something? I'm beginning to suspect that the calendar size is related in some way to display resolution.
ASKER CERTIFIED SOLUTION
Avatar of jimyX
jimyX

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of efz

ASKER

Everything you guys said is true.

I don't have themes enabled and I'm using Delphi 2010.

Inspecting my code more carefully, I noticed that I was also setting the Height property and this may have the effect of generating a comparably-sized drop down calendar. I'm not sure, but it would seem that the Height property trumps the Font.Size property when it comes to the size of the drop down calendar.