locked
VS2010 Windows Forms Designer: Implications of nonstandard screen resolution on your development machine RRS feed

  • Question

  • I have been using the windows form designer to layout my screens for years, but now that I am preparing to distribute my application, I realize that my development environment (VS2010/WinXP) has system fonts beefed up to large resolution (120 dpi or 125% of normal) and notice that some of my screen layout and graphics are misplaced on other machines.

    Does anyone have any guidance for screen display settings on the windows development machine where the intention is to distribute windows applications for installation on other machines?

    Thanks,  -BGood

     

    mardi 6 juillet 2010 04:03

Toutes les réponses

  • Hi BGood,

    From my experience, the best way to make the application resolution independent is to use some layout technics. Such as Set the Anchor or Dock property to adjust the location and size of each control. You could read the document below which shows the details about how to layout a windows forms application:
    http://msdn.microsoft.com/en-us/library/ms951306.aspx

    You could also write a custom action to set the resolution of the deployment machine. The thread below shows how to configure resolution programmatically:
    http://social.msdn.microsoft.com/Forums/fi-FI/winforms/thread/aa1b2494-b9b4-409f-849d-8e9c4c54d223

    Let me know if this helps or not.
    Aland Li

    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    mardi 6 juillet 2010 10:58
  • Thanks, Aland.  Anchor and Dock properties are set appropriately. I will continue working on this and report back.

    -BGood

    mardi 6 juillet 2010 18:56
  • Hi BGood,

    If you still met the issue, you can post an example here, such as the code of a Form. I have two machines of different DPI and resolution settings, so I think I am able to reproduce your issue.

    Regards,
    Aland Li

    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    mercredi 7 juillet 2010 09:24
  • Hi Aland,

    Thanks for the offer to test different dpi settings, but the software I am working with is pre-release, pre-copyright and cannot be released at this time.  I have reset the development machine to standard 96dpi and am reviewing each form in the designer to insure that I did not set any absolute or relative control locations dependent on the larger fonts.

    In retorspect, I was having a problem with graphic lines I had used as visual separators for lengthy input forms (reference to MSDN http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/bd70a1ff-12f8-411b-a8a1-0f9b074ed43d which may be related to the 125% font size increase.

    As I am reviewing all of my forms, I am replacing the graphic lines with group boxes so that the ogranization and presentation of the databound controls is improved.  However, I had heard that .net performance may be degraded with excessive use of panels, group boxes, and other containers for databound controls.  I have not experienced this myself, but did find some unusual behavior when the group boxes were first introduced (http://social.msdn.microsoft.com/Forums/en-US/winformsdesigner/thread/d6634918-7a08-492a-bce4-d10cad7d01ff).

    Thanks,

         -BGood

    mercredi 7 juillet 2010 12:15
  • Hi BGood,

    Based on my understanding,  the issue that the form is not shown is not related to the GroupBox or what and how many container controls are added to the Form. Actually, adding too many controls will indeed lead to low performance, but it is OK in your case, since there are only 8 containers.

    Occasionally, some forms will not be shown correctly. This is often because a top most form(Form.TopMost = true) hide it or some code cause the shown forms hidden(For example, set its Visible property to false in the Load or Shown event handler). You need to check your code logic to see if one of the cases happen.

    Let me know if this does not help.
    Aland Li

    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    jeudi 8 juillet 2010 03:47
  • Hi Aland,

    In order to provide quick UI response to alternate data views in the same windows form, I will typically add 3 split containers to the form before adding any data-bound controls. SplitContainerMain typically divides the form into right and left panels, and SplitContainers Right and Left divide the SCMain panels into upper and lower subpanels.  The groupBoxes discussed previously are contained in a panel which provides data-bound details, so in fact I have 11 containers in addition to the form itself.  Display state logic controls panel visibility depending upon what the user wants to do.

    It is interesting that the SplitterContainer and LayoutTable seem to be the windows form controls most impacted by changes in screen dpi settings.

    Thanks for your help.

         -BGood

    jeudi 8 juillet 2010 16:10
  • Hi BGood,

    From my experience, TableLayoutPanel's performance is lower than other container controls, like Panel, since it need to support more features and more complicated. You can take a look at the document below which shows some clues about how to create a High-DPI application:
    http://msdn.microsoft.com/en-us/library/dd464660(VS.85).aspx#dpi_related_apis

    Regards,
    Aland Li

    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg@microsoft.com


    Please mark the replies as answers if they help and unmark if they don't. This can be beneficial to other community members reading the thread.
    vendredi 9 juillet 2010 11:09