CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2012
    Posts
    1

    how to create Resolution independent Windows forms

    See more: WindowsC#3.5Forms
    Hai ,
    We have Developed an Windows Forms Application Project, In that what we need is we have to Make my Application Independent of the System screen resolution.i.e My Application resolution should be stable even though System screen resolution changed.

    I have Tried one Example from Microsoft Site, i.e
    http://msdn.microsoft.com/en-us/library/ms812499.aspx[^]

    In that, When i run the Program the whole system resolution is changed to given size Including the Application..

    But what i need is i need to Fix my Application size stable, Even though the resolution of the system is changed(i.e if the system resolution is changed to lower my application need to exist towards big size and vise verse )..


    And i have also observed the code given by MicroSoft which is in Visula Basic, not in Dotnet..
    that link is

    http://support.microsoft.com/kb/1820...d=2971&sid=195


    Please give me the Code to Make my widows application Resolution independent....
    or Show me Any changes in the above MSDN code to achieve my requirement..


    Thank You

  2. #2
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: how to create Resolution independent Windows forms

    Why not just use the Properties provided in the Properties window?

    I am talking about the Dock and Anchor properties. They are all you need.

  3. #3
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: how to create Resolution independent Windows forms

    I'm not sure what the OP is even asking. If you set your form to be 800x600 it will always be 800x600 regaurdless of the system resolution settings. If will simply take up more or less of the screen depending on what the system res is set to.
    If the intent is to scale the forms so they always take up 60% of the screen that is another matter.

    Not sure what he is looking for.
    Always use [code][/code] tags when posting code.

  4. #4
    Join Date
    Jan 2010
    Posts
    1,133

    Re: how to create Resolution independent Windows forms

    He talks about automatic rescaling of the visual content, keeping sizes the same across various screen resolutions (pixelsW x pixelsH), for the given DPI value.

    This is already fully supported by WPF - so you might want to switch from WinForms to WPF.
    WPF sizes are specified in device-independent units.

    I only had a glimpse of the article your second link leads to, but it looks like it shows how to rescale a WinForms window and elements using some base resolution as a reference point.
    Have you tried to follow the example? Can you be more specific about the problem?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured