Question

Will WinForms apps run slower on larger monitors(i.e. larger resolution) as opposed to smaller all else being equal? My gut says yes, as there's more real estate to paint, but I cannot find any information anywhere regarding the effects.

I ask because we have a WinForms application that generally runs on two 22 inch monitors, but we have a couple users who run it on two 30 inch monitors, and they always seem to have more lag in their GUI than anyone using the 22 inch monitors.

No correct solution

OTHER TIPS

The issue isn't really the number of inches, its the number of pixels.

Drawing to a 800x600 screen is less work than drawing to a 1920x1080 screen (roughly 4x less work).
Still, most of that work is likely done by a graphics card, and won't affect CPU load all that much.

Having graphics cards from competing chip makers (one nVidia and one ATI) may cause slow downs.

The application in question might also be poorly painting and it's not as obvious when the window is smaller but when it's bigger on the bigger displays the poor painting code is a bigger hotspot. You could try using a profiler to see what's going on. Visual Studio has one built in now, or you could try DotTrace http://www.jetbrains.com/profiler/

For the build-in winform controls, the difference won't be that much. In general, the rendering of these controls is pretty fast on any resolution.

Check if you are using custom painted controls. In many cases the performance is poor if the paint method is not implemented well. For example if you draw pixels (nested loops for width and height) the performance will slow down dramatically with increasing resolutions.

Another trick for custom controls is to enable double buffering, it can speed up things a lot for heavy paint routines:

public partial class YourControl : Control
{
    public YourControl()
    {
        InitializeComponent();

        this.SetStyle(
            ControlStyles.UserPaint |
            ControlStyles.AllPaintingInWmPaint |
            ControlStyles.DoubleBuffer, true);
    }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top