This is post https://excelfox.com/forum/showthrea...ge43#post12697
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page43#post12697
Bitlylink: https://bit.ly/3P792Jk https://bit.ly/3PbdpD1 Tinylink: https://tinyurl.com/43nehmna
Chris isn’t taking any notice of everyone telling him his GUI is too big, good for him !! ( or he goes off talking some bollox about auto resizing and or Windows Forms shit). I could be wrong. Maybe he knows what he is talking about, but no one else does.
( Here are some current ( Open as of Feb. 2022 ) Issues over at GitHub
260 The User Interface is cut off on smaller screens https://github.com/ChrisTitusTech/wi...ipt/issues/260
1920x1080 screen with 125% display scaling
223 Can't resize window https://github.com/ChrisTitusTech/wi...ipt/issues/223
Maximize workaround
212 Make Window Resizable https://github.com/ChrisTitusTech/wi...ipt/issues/212 I was able to go into my display settings and scale my display down to 100%, which allows me to fit the entire window on my screen, but just barely.
After doing this, I think I actually prefer this scaling over the " 125%, but I still wanted to mention this here because other users may have the same issue, or may simply find it to their liking to be able to resize the window
196 window size bug https://github.com/ChrisTitusTech/wi...ipt/issues/196 In the meantime, what you might try doing is going into your display settings and change your display scaling. Windows had my display scaled to 125% by default. I scaled it down to 100% and I'm now able to see the whole window. It did make everything else on my screen much smaller, which I personally don't mind. I think I may actually keep it this way.
)
( I solved them all and dozens, if not hundreds more at YouTube more before the dopey Bot deleted everything )
A quick word to the PoshGUI issue...
Chris's Posh GUI appears to have bloated the script with a lot of bollox. It bloats with repeated, and unnecessary coding. But that is an academic point, and, in any case, that is a bit off the point of the too big GUI issue, - that bloating is not directly the cause of the too big GUI issue here, (even though Chris seems to think so sometimes!!)
Looping to reduce the bloat of repeated stuff with functions, as suggested in some Pull requests, is perhaps better programming practice. But that is Chris's choice: It does no harm to use the code spewed out by PoshGUI for the general layout. It won't have any effect on the too big fucked up non working scroll bar, non working resize issue.
I suspect more likely that this too big and fucked up scrolling, fucked up resizing, GUI issue, is some combination of a copy and paste not done properly, along with some furkin forked pushed pull crap at GitHub that messed it up a but further.
But never mind all that...
Anyways.... - onward
The following may not be the full answer, but it seems to come close. It mainly only requires only removing 9 unnecessary lines that fuck everything up!
To explain
This is the current bit of GUI related script
Share ‘BloatedGUI.ps1’ https://app.box.com/s/1db6h5j765wc4jyjfqdn0mu9mdesb2ye
Code:
$Form = New-Object system.Windows.Forms.Form
$Form.ClientSize = New-Object System.Drawing.Point(1050,1000)
$Form.text = "Windows Toolbox By Chris Titus"
$Form.StartPosition = "CenterScreen"
$Form.TopMost = $false
$Form.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#e9e9e9")
$Form.AutoScaleDimensions = '192, 192'
$Form.AutoScaleMode = "Dpi"
$Form.AutoSize = $True
$Form.AutoScroll = $True
$Form.ClientSize = '1050, 1000'
$Form.FormBorderStyle = 'FixedSingle'
# GUI Icon
$iconBase64 = 'AAABAAMAMDAAAAEAIACoJQAANgAAACAgAAABACAAqBAAAN4lAAAQEAAAAQAgAGgEAACGNgAAKAAAADAAAABgAAAAAQAgAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA //8AAP//AAD//wAA//8AAP//AAA='
$iconBytes = [Convert]::FromBase64String($iconBase64)
$stream = New-Object IO.MemoryStream($iconBytes, 0, $iconBytes.Length)
$stream.Write($iconBytes, 0, $iconBytes.Length)
$Form.Icon = [System.Drawing.Icon]::FromHandle((New-Object System.Drawing.Bitmap -Argument $stream).GetHIcon())
$Form.Width = $objImage.Width
$Form.Height = $objImage.Height
( Full current Chris script: Share ‘win10debloatChrisFeb2022.ps1’ https://app.box.com/s/btt9pu8ri9z44dfv6a08o6fqwm8jhuh9 ) )
That script causes typically this ( screen resolutions: 1366x768 1440x900 1920x1080 2560x1440 ) :

So as you see, there is a slight dependency of size appearing on the screen to the resolution.
A higher resolution and it comes up a little smaller
1920x1080 is just about OK, and the over average used high of 2560x1440 is not too bad. I expect this latter is often what Chris uses.
The scroll bar usually doesn’t work, and usually is not there. If it is s there initially it soon vanishes making it usually impossible to get at the lower buttons

It is not resizable,
_.________________________________________________ _________
Solution1
This script comes close to solving all problems: The main change is simply removing 9 lines of bloat
Code:
$Form = New-Object system.Windows.Forms.Form
#$Form.ClientSize = New-Object System.Drawing.Point(1050,1000)
$Form.text = "Windows Toolbox By Chris Titus"
$Form.StartPosition = "CenterScreen"
#$Form.TopMost = $false
#$Form.BackColor = [System.Drawing.ColorTranslator]::FromHtml("#e9e9e9")
#$Form.AutoScaleDimensions = '192, 192'
#$Form.AutoScaleMode = "Dpi"
#$Form.AutoSize = $True
$Form.AutoScroll = $True
$Form.ClientSize = '900, 900' # '1050, 1000'
#$Form.FormBorderStyle = 'FixedSingle'
# GUI Icon
$iconBase64 = 'AAABAAMAMDAAAAEAIACoJQAANgAAACAgAAABACAAqBAAAN4lAAAQEAAAAQAgAGgEAACGNgAAKAAAADAAAABgAAAAAQAgAAAAAAAAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA //8AAP//AAD//wAA//8AAP//AAA='
$iconBytes = [Convert]::FromBase64String($iconBase64)
$stream = New-Object IO.MemoryStream($iconBytes, 0, $iconBytes.Length)
$stream.Write($iconBytes, 0, $iconBytes.Length)
$Form.Icon = [System.Drawing.Icon]::FromHandle((New-Object System.Drawing.Bitmap -Argument $stream).GetHIcon())
#$Form.Width = $objImage.Width
#$Form.Height = $objImage.Height
Share ‘win10debloatChrisFeb2022UnFuckedGUI.ps1’ https://app.box.com/s/9uc5bl5w4l3kap4stt9alknswab1ogth
Share ‘UnBloatedGUI.ps1’ https://app.box.com/s/x84dbsw28ugyp5u9ga5msrq2c4nc9j82

It has a scroll bar that works to some extent**
It is resizable ( by dragging bottom right corner or by dragging bottom border or by dragging right border )
( https://i.postimg.cc/jjcLcSCQ/Can-Re...-Bars-Work.jpg )
( **The only issue I have is that the vertical scroll bar on the right is a bit quirky sometimes. But I have seen similar to that on other GUIs intermittently. So that may be some bug in PowerShell. (.. Or a problem with Windows: It only happens sporadically in some extended monitor set ups- After Vista, Microsoft seem to have screwed up something related to multiple monitor use )
The better fuller Solution2 would be to reduce all button sizes to something more sensible, example:
https://excelfox.com/forum/showthrea...ge50#post12773

_._________________________________________
See also here
https://excelfox.com/forum/showthread.php/2408-Windows-10-and-Office-Excel/page50#post12771
https://excelfox.com/forum/showthrea...ge50#post12771
https://excelfox.com/forum/showthrea...ge52#post12786
https://github.com/ChrisTitusTech/wi...ent-1041595552
Bookmarks