Solved

Sizing the TDateTimePicker Component

Posted on 2011-03-11
5
870 Views
Last Modified: 2012-05-11
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.
0
Comment
Question by:efz
  • 2
  • 2
5 Comments
 
LVL 24

Expert Comment

by:jimyX
ID: 35112979
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".
0
 

Author Comment

by:efz
ID: 35116100
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.
0
 
LVL 24

Accepted Solution

by:
jimyX earned 250 total points
ID: 35116594
>  "changing the font has nothing to do with how large the drop down calendar is"

Have you tried and tested by setting the font as I suggested? When the font size is 8 the drop down calender size differs than when it's 24:

Simple comparison without changing the display resolution:

MS Sans Serif - 8
MS Sans Serif - 24

>  "The font property only seems to govern the text in the display box only"

That's true, but the size of the drop down calender shrinks or expand according to the font size.

All Visual Controls' size is related to the display resolution.
0
 
LVL 32

Assisted Solution

by:ewangoya
ewangoya earned 250 total points
ID: 35119354

@jimyX
If you disable Runtime themes, then the font size of the component will affect the size of the calendar.
Or if you are using an older version of Delphi without a Manifest otherwise the font size will have no bearing on the calendar size


@efz
What version of Delphi are you using?
If you have runtime themes enabled, then it may as well be the system settings that affect the size of your calendar
(Resolution or Font Size etc)
0
 

Author Closing Comment

by:efz
ID: 35122593
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.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IExtractImage Delphi 14 207
ddeman not working in activex 3 93
oracle global variables 4 63
Installshield for Embarcadero EX 10.1 Berlin 4 21
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now