0

I have a winform application, with multiple dockable forms. In one of the dockable forms, i am seeing a resize issue of the content (described below), the document outline of which is as follows:

enter image description here

Problem: when i run the application .exe directly from build folder, the content of tabpage1 gets displayed properly, as seen in the screenshot:

enter image description here

but when the application is installed and run, then the content of tabpage1 gets resized (size of each control increases) as seen in the below screenshots: (became so large that i had to take 2 screenshots)

left portion: enter image description here

right portion (after scrolling) enter image description here

Question: I guess some of the properties of tabpage1 is causing this issue, but i am not sure. In another tabpage, i have much longer textboxes, could this be affecting the tabpage1 displayed size? Can anyone tell me what could be the issue or point out to me which property (of which control) is causing this issue? Just to remind, the problem occurs only when it is installed and run.

Notes:

  1. tabcontrol1 => Dock=Fill, Anchor= Top, Left

  2. tabpage1 => AutoScroll = True, AutoScrollMinSize are set.

  3. All the tabpages are not seen at first run, these are inserted/removed programmatically based on business logic.

  4. I have also tried with taking these UI controls in a panel/groupbox/tablelayoutpanel etc. in that tabpage, but no affect. so there is some size issue/unwanted settings with the tabcontrol/tabpage itself.

  5. I am running this in Windows10 OS.

  6. I am using VS2013.

  7. all are standard controls of .net

Pankaj_Sen
  • 61
  • 9
  • https://learn.microsoft.com/en-us/dotnet/desktop/winforms/high-dpi-support-in-windows-forms?view=netframeworkdesktop-4.8 – dr.null Jun 13 '23 at 18:15
  • @dr.null thanks for the link, but not applicable as my application targets to .net4.5 only. Also in the case i described, there is no change of the system/dpi where i am testing it; in the same system itself with the same dpi settings, the UI is different when i run the exe directly and when it is run from the installed one, this is strange to me. – Pankaj_Sen Jun 14 '23 at 05:46
  • does enable/visible property of few controls affect UI resize or location of controls in the UI without any kind of explicit resize handlers? in my case, all controls are in that tabpage, not inside any kind of panel too. still i see when few buttons are made visible in the UI based on business logic, the tab page gets resized with a resized scrollbar....any hint on this ? @dr.null – Pankaj_Sen Jun 14 '23 at 06:48
  • seems like my issue is similar to the one described here, but nothing worked for me: https://stackoverflow.com/questions/27633483/my-windows-form-keeps-on-shrinking-resizing-on-build/42421969#42421969 – Pankaj_Sen Jun 14 '23 at 12:52
  • 1
    Make sure that the display scale of the developing environment is 100%. Since you are targeting < 4.7 Framework (no reason to not use the latest 4.8 though and the free vs2022), use the manifest file instead. See [this](https://stackoverflow.com/a/13228495/14171304) answer to do so and [this](https://stackoverflow.com/a/50276714/14171304) one for some more tips. Change your forms `AutoScaleMode` properties from `Font` to `Dpi`. – dr.null Jun 14 '23 at 16:47

0 Answers0