Windows-API-Code-Pack-1.1 icon indicating copy to clipboard operation
Windows-API-Code-Pack-1.1 copied to clipboard

Activeform shrinks when I open Folder dialog

Open zizwiz opened this issue 4 years ago • 3 comments

I start my App and the form is the size I specified. I then click a button to set the folder in a text box as below. When the dialog runs the active form shrinks in size. It shrinks so small it is hard to use. I tried a workround to get size before I open dialog and restore it after but even that is not good. Maybe it is to do with the Desktop size in "Display scale and layout" which I have set to 125%. Maybe this dialog tries to set it to 100%? If you need more info please just get in touch.

Here is the test code I am using. CommonOpenFileDialog folderDialog = new CommonOpenFileDialog();

        folderDialog.InitialDirectory = "C:\\temp";
        folderDialog.RestoreDirectory = true;
        folderDialog.IsFolderPicker = true;
                   
        if (folderDialog.ShowDialog() == CommonFileDialogResult.Ok)
        {
                          txtbx_save_as.Text = folderDialog.FileName; 
        }

zizwiz avatar May 05 '20 10:05 zizwiz

Just to make sure, is this winforms or WPF?

contre avatar Dec 02 '20 01:12 contre

Sorry to jump in on this. Yes, this is WinForms. I had the same issue in my application. Try rebuilding your application for .NET Framework >=4.7 with HighDPI awareness enabled in the app.config and manifest file.

UniqProject avatar Dec 04 '20 16:12 UniqProject

I am having similar issue with .Net Framework 4.8. is there any update on this issue? @contre / @zizwiz

MiteshGohilTR avatar Mar 19 '24 11:03 MiteshGohilTR