I used an online PS GUI editor which seemed simple enough but i have a couple of problems.
1) How do i add an image to the button? Im assuming there is another line i need to add?, the image will be in a folder at the side of the PS file on a usb stick.
Button creation like this
$button2 = New-Object system.windows.Forms.Button $button2.Width = 70 $button2.Height = 70 $button2.location = new-object system.drawing.point(13,13) $button2.Font = "Microsoft Sans Serif,10"
‘
2) how do i make the triggers for the buttons?
How do i add a trigger for the buttons? does it go lower down after the button creation? All i need it to do is open a .ps1 file or an .exe held in a folder at the side of the PS file.
3) One other thought..
When i run the gui in ISE it shows up fine with buttons nicely showing.
When i run it by right click run as powershell it has the background PS window behind it and the buttons only have 2 lines shading them on the right and bottom.
Is it possible to run it without the PS window behind? and why the difference in GFX look?
P.s. this is just a simple gui with 10 buttons to start other scripts no fancy stuff at all
submitted by /u/Chimaera12
[link] [comments]
The post Managed to make a GUI but… appeared first on How to Code .NET.