A
A
Alexander Dorofeev2015-05-08 18:15:05
C++ / C#
Alexander Dorofeev, 2015-05-08 18:15:05

How to flatten all objects on a form (winforms)?

How can I smooth all objects on the form? Moreover, during editing everything looks fine, but at startup it turns out terrible pixelation. Making a smoothed User Control for each element is not an option. I want to do everything at
once
. Do not offer.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Dorofeev, 2015-05-09
@TechCloud

I found how to fix the problem (maybe someone will need it).
You just need to optimize for a high DPI value.
In Program.cs we write:

[STAThread]
    static void Main() {
        if (Environment.OSVersion.Version.Major >= 6) SetProcessDPIAware();
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new MyForm());             //редактируем как нужно
    }

    [System.Runtime.InteropServices.DllImport("user32.dll")]
    private static extern bool SetProcessDPIAware();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question