| CodeGuru Home | VC++ / MFC / C++ | .NET / C# | Visual Basic | Newsletters | VB Forums | Developer.com |
|
|||||||
| Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++. |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to scale size of windows form based on screen resolution?
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! |
|
#2
|
|||
|
|||
|
Re: How to scale size of windows form based on screen resolution?
System:
rawing::Rectangle screenRectangle = Screen::PrimaryScreen->WorkingArea;this->Size = System: rawing::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? |
![]() |
| Bookmarks |
|
||||||
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|