LightingChart affects window maximization

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Arction_LasseP

hyetc
Posts: 10
Joined: Fri Oct 09, 2020 9:26 am

LightingChart affects window maximization

Post by hyetc » Mon Jan 18, 2021 3:52 am

After changing the Win10 system display percentage,LightingChart generates the effect of maximizing the impact window。

Form5 is display Window
private void Form5_Load(object sender, EventArgs e)
{
WindowState = FormWindowState.Maximized;
var frm4 = new Form4
{
TopLevel = false, Dock = DockStyle.Fill
};
panel1.Controls.Add(frm4);
frm4.Show();
}
frm4 is a window with LightingChart placed。 LightingChart reasons not maximized after loading.Remove LightingChart and it will work
Attachments
LayoutDemo.7z
(135.82 KiB) Downloaded 51 times
360截图16571224959686.png
360截图16571224959686.png (221.33 KiB) Viewed 527 times

ArctionKestutis
Posts: 401
Joined: Mon Mar 14, 2016 9:22 am

Re: LightingChart affects window maximization

Post by ArctionKestutis » Tue Jan 19, 2021 7:29 am

Most likely it is about DPI awareness. Even if user would be using WinForms platform, when the LightningChart is created it loads some WPF libraries and because of this the DPI awareness of the application is automatically changed. It changes to the WPF default of ‘system aware’, and the DIP-PX factor is changed to that defined by windows settings. If user’s monitor’s Scale/zoom factor is >100%, then reduction of app window will be visible.
The long answer about issue and how to tackle it is given in the forum's topic. In short, user needs to create application manifest file and set <dpiAware> true </dpiAware>.
To add a manifest to C# application please follow these steps:
a. Right-click on your project in the Solution Explorer.
b. Select "Add New Item" from the context menu.
c. Choose "Application Manifest File" from the list of options in the dialog box that appears.
d. Next open ‘app.manifest’ file, search for ‘dpiAware’ string, un-comment relevant part and set DPI-awareness in a way user wants.

Hope this helps.