CodeGuru Forums -
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic Newsletters VB Forums Developer.com


Newest CodeGuru.com Articles:

  • Installing SQL Server 2008
  • Writing UDFs for Firebird Embedded SQL Server
  • [Updated] Shutdown Manager
  • Building Windows Azure Cloud Service Applications with Azure Storage and the Azure SDK

  • Search CodeGuru:
     



    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Managed C++ and C++/CLI
    FAQ Members List Calendar Search Today's Posts Mark Forums Read

    Managed C++ and C++/CLI Discuss Managed C++ and .NET-specific questions related to C++.

    Reply
     
    Thread Tools Search this Thread Rate Thread Display Modes
      #1    
    Old July 20th, 2005, 03:46 PM
    chinniwhites chinniwhites is offline
    Member
     
    Join Date: Jun 2005
    Posts: 42
    chinniwhites is an unknown quantity at this point (<10)
    How do I scale my windows form to be full screen no matter the resolution?

    I have a program that when launched always launched maximized. This is exactly what i want. The problem is if the user's resolution is 800x600, parts of the program are off the screen (program window too big for resolution). How do I make so no matter what the screen resolution, my program always looks the same?
    Reply With Quote
      #2    
    Old July 20th, 2005, 07:00 PM
    SouthernCodeMonkey SouthernCodeMonkey is offline
    Member
     
    Join Date: Feb 2005
    Posts: 106
    SouthernCodeMonkey is on a distinguished road (40+)
    Re: How do I scale my windows form to be full screen no matter the resolution?

    Use Screen.PrimaryScreen.Bounds.

    This will allow you to dynamically size your form.

    Regards.
    Reply With Quote
      #3    
    Old July 22nd, 2005, 05:46 AM
    Andy Tacker Andy Tacker is offline
    More than "Just Another Member"
     
    Join Date: Jun 2001
    Location: 55°50' N 37°39' E
    Posts: 1,503
    Andy Tacker  is a jewel in the rough (300+)Andy Tacker  is a jewel in the rough (300+)Andy Tacker  is a jewel in the rough (300+)Andy Tacker  is a jewel in the rough (300+)
    Re: How do I scale my windows form to be full screen no matter the resolution?

    best way is to make your program for the minimum resolution... say 800x600 or 1024x768
    and use "Anchor Style" property... then you will have the desired view.
    __________________
    If you think you CAN, you can, If you think you CAN'T, you are probably right.

    Have some nice Idea to share? Write an Article Online or Email to us and You may WIN a Technical Book from CG.
    Reply With Quote
      #4    
    Old July 22nd, 2005, 10:46 AM
    chinniwhites chinniwhites is offline
    Member
     
    Join Date: Jun 2005
    Posts: 42
    chinniwhites is an unknown quantity at this point (<10)
    Re: How do I scale my windows form to be full screen no matter the resolution?

    I wrote the program using 1024x768 resolution. I dont see the Anchor Styles in the properites window. So how would I go about this using either of methods suggested above this post?
    Reply With Quote
      #5    
    Old July 25th, 2005, 11:07 AM
    chinniwhites chinniwhites is offline
    Member
     
    Join Date: Jun 2005
    Posts: 42
    chinniwhites is an unknown quantity at this point (<10)
    Re: How do I scale my windows form to be full screen no matter the 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?
    Reply With Quote
      #6    
    Old July 25th, 2005, 09:26 PM
    SouthernCodeMonkey SouthernCodeMonkey is offline
    Member
     
    Join Date: Feb 2005
    Posts: 106
    SouthernCodeMonkey is on a distinguished road (40+)
    Re: How do I scale my windows form to be full screen no matter the resolution?

    Did you try using Use Screen.PrimaryScreen.Bounds?

    Regards.
    Reply With Quote
      #7    
    Old July 26th, 2005, 09:34 AM
    chinniwhites chinniwhites is offline
    Member
     
    Join Date: Jun 2005
    Posts: 42
    chinniwhites is an unknown quantity at this point (<10)
    Re: How do I scale my windows form to be full screen no matter the resolution?

    Is that it? Just put the following statement somewhere in my code:

    Screen::PrimaryScreen->Bounds;

    Please let me know!
    Reply With Quote
      #8    
    Old July 26th, 2005, 10:42 AM
    SouthernCodeMonkey SouthernCodeMonkey is offline
    Member
     
    Join Date: Feb 2005
    Posts: 106
    SouthernCodeMonkey is on a distinguished road (40+)
    Re: How do I scale my windows form to be full screen no matter the resolution?

    Sorry, it was an assumption of mine that if you were given a method to obtain the desktop resolution, you would be able to use that to scale the form.

    Seeing as I have no intimate knowledge of your GUI design and how it should look, I will have to leave that to you.

    Good luck.
    Reply With Quote
    Reply

    Bookmarks
    Go Back   CodeGuru Forums > Visual C++ & C++ Programming > Managed C++ and C++/CLI


    Thread Tools Search this Thread
    Search this Thread:

    Advanced Search
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 06:38 PM.



    Acceptable Use Policy

    internet.comMediabistrojusttechjobs.comGraphics.com

    WebMediaBrands Corporate Info


    Advertise | Newsletters | Feedback | Submit News

    Legal Notices | Licensing | Permissions | Privacy Policy


    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
    Copyright WebMediaBrands Inc. 2002-2009