?
Solved

Sizing the TDateTimePicker Component

Posted on 2011-03-11
5
Medium Priority
?
974 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1000 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:Ephraim Wangoya
Ephraim Wangoya earned 1000 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month8 days, 5 hours left to enroll

765 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