BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use of TMonthCalendar control

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Daryl
Guest





PostPosted: Fri Apr 23, 2004 7:03 am    Post subject: Use of TMonthCalendar control Reply with quote



Hi all
I have placed a TMonthCalendar control onto a TForm. The idea is to allow
the user to open the form using ShowModal, I then retrieve the date selected
by the user. This all works fine.

The problem is with machines with different Font Settings ie Small 96 pixels
per inch verses 120 pixels per inch Large Fonts.

I tried to set the form's Client height and width using the calendar's
height and width but when the form is opened on a 120 ppi machine there is a
reasonably large border about the calendar (note the borders are unequal in
width).

Note : I have also set the calendar control to be aligned to the Client.

Anyone have any ideas how to overcome this problem??

Thanks
Daryl


Back to top
JD
Guest





PostPosted: Fri Apr 23, 2004 8:18 am    Post subject: Re: Use of TMonthCalendar control Reply with quote




"Daryl" <stockd (AT) tpg (DOT) com.au> wrote:
Quote:
[...] Anyone have any ideas how to overcome this problem??

I get that there is a difference with the 2 settings but you
didn't say what the problem was with them.

~ JD


Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Fri Apr 23, 2004 6:59 pm    Post subject: Re: Use of TMonthCalendar control Reply with quote




"Daryl" <stockd (AT) tpg (DOT) com.au> wrote


Quote:
The problem is with machines with different Font Settings
ie Small 96 pixels per inch verses 120 pixels per inch Large Fonts.

Design forms that work with both Large Fonts and Small Fonts
http://www.bcbdev.com/faqs/faq96.htm


Gambit



Back to top
Daryl
Guest





PostPosted: Fri Apr 23, 2004 9:18 pm    Post subject: Re: Use of TMonthCalendar control Reply with quote

Thanks for the reply JD
The problem was that the Calendar control completely filled the form on the
96 ppi machine but had an unequal grey (in this case) boarder about the
calendar on the 120 ppi machine.

Anyway, I think I stumbled onto a solution / workaround. It uses the
following method:

1) the form containing the Calendar control has its property AutoSize set to
true

2) during the construction of the form that has to neatly contain the
Calendar control I used this code:

TRect r;
MonthCal_GetMinReqRect(cal->Handle, &r);
this->AutoSize = true;
SetWindowPos(cal->Handle, NULL, 0, 0, r.right, r.bottom+1, SWP_NOZORDER);

Seems to do the job, I have checked it on three machines and the Calendar
control with no extra boarder is displayed independent on what the ppi (font
setting is).

Daryl


"JD" <nospam (AT) nospam (DOT) com> wrote

Quote:

"Daryl" <stockd (AT) tpg (DOT) com.au> wrote:
[...] Anyone have any ideas how to overcome this problem??

I get that there is a difference with the 2 settings but you
didn't say what the problem was with them.

~ JD




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.