dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.42k stars 984 forks source link

Size of the control placed in toolstripcontainer is wrong in extended monitor when changing padding of toolstrip #6681

Closed AmalRajUmapathySelvam closed 2 years ago

AmalRajUmapathySelvam commented 2 years ago

Problem description:

We have created an application with add-in express and extends the application to the external monitor with below mentioned screen resolution specifications.

Primary Monitor: DPI - 150 Screen resolution - 1920*1080

Secondary Monitor: (4K) DPI - 100 Screen resolution - 1920*1080

We have changed the padding of the toolstrip with add-in and the issue occurs in external monitor. This issue not reproduced with primary monitor and with other screen resolutions.

In the below attached example, we have placed the MS DataGridView as content for ToolStripContainer.ContentControl and we believe the issue can be reproduced with any other controls. And seems sizing the child controls as per padding is improper with toolstrip and toolstripcontainer.

Expected behavior: Control size should be proper as per the size of the ToolStripContainer.ContentControl.

Sample: - ToolstripPaddingIssue.zip

Minimal repro: 1) Use Microsoft Excel Add-in express. 2) Run the application. (Launched in excel) 3) Move to menu section and click "Click here to change padding" menu. 4) And click on the ribbon button shown. 5) Change the padding repeatedly through the dropdown available in form shown.

merriemcgaw commented 2 years ago

This repo is for WinForms in .NET, and if we need to change this behavior in .NET Framework we need to go through customer service because this would need to be serviced in the .NET Framework and has it's own servicing process. Unfortunately, this case is unlikely to meet the servicing bar. I'm afraid we can't take action here. For your current situation we recommend that you set the application to be DPI Unaware.