For the last while, I've been working on fixing one of my GUIs developed in Powershell Studio to allow it to display correctly on high DPI screens. (It turns out my original design was NOT very high DPI friendly). With the assistance of https://info.sapien.com/index.php/guis/ ... i-displays, it's looking much better, but I still have some questions.
Firstly, the article mentions the SetDPIAwareness snippet.. Where does that go, and is it still needed?
Secondly, Layout issues are being resolved by TableLayoutPanels, and docking. I'll then scale the tablelayoutpanel using a small loop within the form_load, eg:
- $colCount = $tablelayoutpanel1.ColumnCount
- for ($col = 0; $col -lt $colCount; $col++){
- $tablelayoutpanel1.ColumnStyles[$col].Width = ConvertTo-ScaledPixel -Form $form1 -Width $tablelayoutpanel1.ColumnStyles[$col].Width
- }
The problem then is that the contents of the cells do not also scale. Labels look like they do scale up, but not text boxes or other object types. From the article, it looked like text boxes should scale, as long as the font is set.
Is there a way to automatically scale these elements?
Or do I just need to set the scaling on everything?
If someone does have a sample of an application with various elements (text boxes, labels, tabs) etc, that they are willing to share, it would be appreciated.