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 25th, 2005, 10:25 AM
    chinniwhites chinniwhites is offline
    Member
     
    Join Date: Jun 2005
    Posts: 42
    chinniwhites is an unknown quantity at this point (<10)
    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!
    Reply With Quote
      #2    
    Old July 25th, 2005, 11:06 AM
    chinniwhites chinniwhites is offline
    Member
     
    Join Date: Jun 2005
    Posts: 42
    chinniwhites is an unknown quantity at this point (<10)
    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?
    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 01:01 AM.



    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