Click to See Complete Forum and Search --> : How to scale size of windows form based on screen resolution?


chinniwhites
July 25th, 2005, 10:25 AM
I developed my program with a screen resolution of 1024x768. My actuall form size is 1036x780. I have posted this question before and someone said use
screen.primaryscreen.borders. Problem there is that primaryscreen does not have a borders member. So i want trying to do something like this but it constantly gives me compile errors about calling a non-static function:

In Initialize Components,

this->DesktopBorders = Screen::PrimaryDisplay

or

this->DesktopBorders = Screen::get_Borders(Screen::WorkingArea);

I have been trying several different things but nothing works. So please, respond to this post!

chinniwhites
July 25th, 2005, 11:06 AM
System::Drawing::Rectangle screenRectangle = Screen::PrimaryScreen->WorkingArea;
this->Size = System::Drawing::Size(screenRectangle.Width-10, screenRectangle.Height-10);

I used this in my initializecomponents section of my windows forms code. It still did not scale my program to fit the screen at 800x600. Any suggestions?