5b) GUI redesign. GUI code Debloat
_5b) A few obvious minor issues in Chris’s code..
The Problem/ Characteristic/ Feature/ Reality.
The GUI, and the use of it in Posh GUI looks great and big and great and awesome in a YouTube Video.
That’s good enough reason to use it. Chris will and that’s fine by me. All power to him and his YouTube stuff. He has saved me loads of time.
Post GUI totally fucks up code development. (Use GitHub and the disaster is complete)
I think its designed to be like the VBA macro(code) generator. It pukes out code for what you do, and / or what you end up with.
It’s helpful to get you started, but Nothing else in code development. Inevitably you end up with repeated, redundant, contradicting, inefficient coding. Even worse if you continue to use it. It just bloats up to a ridiculous amount.
A few obvious minor issues in Chris’s GUI related code…
The GUI come up too fucking big.
_ The .AutoSize = True and .AutoScroll = True are a bit contradictory and cause it to bloat up, and if occasionally the scroll bar appears, it usually vanishes. Its unstable. The .AutoSize = True needs to be removed.
_ There seems to be two lines to size the GUI. They have the same dimensions. They are a bit different but I expect either one will do
_ I think Chris sees it at a size that, on average, is a bit smaller than most people see it. I think he uses , on average, a higher screen resolution, which somehow seems to effect the GUI size in his messed up coding. Instead of two code lines giving the dimension of '1050, 1000' , perhaps the simplest of the two with '800, 600' is about right for most people
_ Some other code lines may have been puked out by Posh GUI and aren’t needed, I am not sure. Some things will be at the default value, and the code lines will reflect this. I probably would not delete those lines as they could be useful to use later if I want to try out non default values, but I would #comment them out.
Here are the sane code lines for a simple GUI. It will come up in a convenient size, has a scroll bar and you can resize it
Anything else is bloatCode:Add-Type -AssemblyName System.Windows.Forms $Form = New-Object system.Windows.Forms.Form # Create a new form $Form.ClientSize = '800, 600' # Define the size $Form.AutoScroll= $True # Adds a scroll bar if needed – example if You have added panels ( ranges ) bigger than the size $Form.StartPosition = "CenterScreen"# Personal choice if you want it to come up middle screen [void]$Form.ShowDialog() # Display the form
https://i.postimg.cc/tgH3rXR0/Simple-GUI.jpg https://i.postimg.cc/Y2yQ5N2z/GUI-comes-up.jpg
_.__________________________________________---------
( I am not sure what these two lines do either , other than fuck things up a bit more
$Form.Width = $objImage.Width
$Form.Height = $objImage.Height )
See also here:
GUI Too Fucking big https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page43#post12697
https://excelfox.com/forum/showthrea...ge43#post12697





Reply With Quote
Bookmarks