Board index » cppbuilder » How to re-size the form according to the screen size
Rob Kem
![]() CBuilder Developer |
Thu, 01 Dec 2005 02:39:58 GMT
|
Rob Kem
![]() CBuilder Developer |
Thu, 01 Dec 2005 02:39:58 GMT
How to re-size the form according to the screen sizeHi All, I built an application on my PC with 1024 x 768 window size. Thanks in advance |
Team
![]() CBuilder Developer |
Thu, 01 Dec 2005 04:10:35 GMT
Re:How to re-size the form according to the screen sizeQuote"Rob Kemp" <Masf140...@yahoo.com> wrote in message Quote> I built an application on my PC with 1024 x 768 allow it to stretch larger for 1024x768. Don't try to design it for 1024x768 and have it shrink for 800x600. Also, you'll need to make sure the Align and Anchor properties t make sure things remain positioned where you want them to be positioned when resizing does occur. Gambit |
JD
![]() CBuilder Developer |
Thu, 01 Dec 2005 04:58:55 GMT
Re:How to re-size the form according to the screen size"Remy Lebeau \(TeamB\)" <gambi...@yahoo.com> wrote: Quote> Better to do it the other way around - design your form for ~ JD |
JD
![]() CBuilder Developer |
Thu, 01 Dec 2005 04:53:05 GMT
Re:How to re-size the form according to the screen sizeQuote"Rob Kemp" <Masf140...@yahoo.com> wrote: the forms client and non-client areas. The forms Height and Width properties only deal with the forms client area so when you are determining the forms dimensions, you must take into account that the non-client area is not the same on all versions of Windows (the height is greater on XP machines). You can use the global Screen variable to read information Screen->DesktopHeight Note that CaptionHeight + Form1->Height does not equal the on- In conjunction with resizing the forms dimensions, you'll also For each individual object, use it's Anchors property to ~ JD |
Rhys Sag
![]() CBuilder Developer |
Thu, 01 Dec 2005 02:55:02 GMT
Re:How to re-size the form according to the screen sizeBut clicking the little square in the top right corner will do this for you. Alternatively, you can set the window state to wsMaximized. -- Rhys Sage. Thought of the day: -Voltaire (Team Zip) Quote"Rob Kemp" <Masf140...@yahoo.com> wrote in message Quote
Quote
|
rob kem
![]() CBuilder Developer |
Thu, 01 Dec 2005 08:19:00 GMT
Re:How to re-size the form according to the screen sizeThanks all for your reply. "Remy Lebeau \(TeamB\)" <gambi...@yahoo.com> wrote: Quote
|
Rhys Sag
![]() CBuilder Developer |
Thu, 01 Dec 2005 08:51:34 GMT
Re:How to re-size the form according to the screen sizeSimple... Use my resizing library: //------------------------------------------------------------------------- void ResizeHandling::SetVerifiedWindowSize(int& Vert, int& Horiz) void ResizeHandling::SetWindowSize(int XX, int XY) |
Team
![]() CBuilder Developer |
Thu, 01 Dec 2005 08:59:27 GMT
Re:How to re-size the form according to the screen sizeQuote"rob kemp" <Masf140...@yahoo.com> wrote in message Quote> I'll re-shape the forms in the 800x600 mode but everything will automatically stretch for you. If you design a form in 800x600, then it will remain 800x600 even if the monitor is running in 1024x768 mode. However, you can simply resize the main TForm itself according to the current global Screen->Width and Screen->Height properties and everything else should stretch to accondate the new size when Align and Achors are used. Gambit |
DreamChase
![]() CBuilder Developer |
Thu, 01 Dec 2005 09:41:18 GMT
Re:How to re-size the form according to the screen sizeQuote"JD" <nos...@nospam.com> wrote in message Quote
Form->ClientHeight? |
Maynard Philbroo
![]() CBuilder Developer |
Thu, 01 Dec 2005 10:09:01 GMT
Re:How to re-size the form according to the screen sizeTo add fuel to the fire i can state that at D3 and i think still current even after the report was sent to Borland long ago for my self i have placed my own fix in the form.pas file in anyways in the readstate of the form is where the scaling factors are caculated via system font info. this info is follows the PPI settings, (large/smal/ fonts); anyways the problem is that how borland calculates the values causes problems on Japenese Versions of the OS running an ASCI font set. the font size/Height (can't remember which one at the moment) values report unexpect values that can cause a normal app on a system that was designed at 96 DPI also running in a Japanese system at 96 DPI to shrink your forms if you have scale := true; this problem does not take place on apps writen in other tools like VC++ because of the way its calculated. for what ever reason borland does not fully use the PixelsPerInch value which always reports correctly on a Japanese system. so i took it onto my self to fix that and also submitted to borland long ago. they replied stated that the problem was varified. then come along D4, D5. ... problem still exists. so there you go. QuoteDreamChaser wrote: |
Team
![]() CBuilder Developer |
Thu, 01 Dec 2005 15:07:57 GMT
Re:How to re-size the form according to the screen sizeQuote"DreamChaser" <jkof...@bellsouth.net> wrote in message Quote> If this is true than what is the difference between including the non-client areas, while the ClientHeight is just the client area only. I just verified it with an on-screen pixel ruler. Think about it - if they always had exactly the same value, then there would Gambit |
JD
![]() CBuilder Developer |
Thu, 01 Dec 2005 15:25:44 GMT
Re:How to re-size the form according to the screen sizeQuote"DreamChaser" <jkof...@bellsouth.net> wrote: combination of the forms client and non-client areas. However, it is NOT true that the forms Height and Width properties only deal with the forms client area. They do in fact determine the forms total height in pixels. Good catch thank you. Even Gambit didn't see it :-0 (or he didn't correct me). I worked this out a while ago and going back to my code I see Quote> than what is the difference between Form->Height and Form->ClientHeight? wonder in what version that they first appeared or if they've been there all the long). After playing with them a bit I see that one could use them for what I had suggested but again it's a big hack instead of just using the Screen->DesktopHeight as the forms max height and using panels and their Align properties. ~ JD |
JD
![]() CBuilder Developer |
Thu, 01 Dec 2005 15:28:44 GMT
Re:How to re-size the form according to the screen sizeQuote"JD" <nos...@nospam.com> wrote: ~ JD |
Palle Meiner
![]() CBuilder Developer |
Thu, 01 Dec 2005 20:54:40 GMT
Re:How to re-size the form according to the screen sizeThe VCL also has some methods for scaling controls - ScaleBy - ScaleControls - ChangeScale e.g. void __fastcall TForm1::FormCanResize(TObject *Sender, int &NewWidth, Quote} independently Palle Quote"Rhys Sage" <No.Spam@ta> wrote in message Quote> Simple... Use my resizing library: |
Rhys Sag
![]() CBuilder Developer |
Thu, 01 Dec 2005 21:07:49 GMT
Re:How to re-size the form according to the screen sizeI wrote that library for use with BCB v3. I don't believe the controls you mention were introduced before v6. -- Rhys Sage. Thought of the day: -Voltaire (Team Zip) Quote"Palle Meinert" <i5...@civil.auc.dk> wrote in message Quote> The VCL also has some methods for scaling controls |
1. Form resize based on screen size?
3. Form Resize - minimum size of form?
4. Resizing the size of screen (also fonts)
5. Help Resizing components when screen size changes
6. resize according to screen resolution
7. TBitmap sizing taking into account screen size
8. problem with font size with form resize