Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Using a form button to call another form?

$
0
0

I'm using a function to create buttons, the process looks like this:

Powershell
Process{$Button=New-ObjectSystem.Windows.Forms.Button-Property@{Location=New-ObjectSystem.Drawing.Point($X_Position,($Y_Position+$Order*$Y_Height))Size=New-ObjectSystem.Drawing.Size($X_Size,$Y_Size)Name=$NameText=$TextDialogResult=[System.Windows.Forms.DialogResult]::$DialogResult}$Form.AcceptButton=$Button$Form.Controls.Add($Button)}}

I'm trying to use this function to create a button which opens another form window. I've got a proof of concept using this:

Powershell
#Calls the required modules for the scriptAdd-Type-AssemblySystem.Windows.FormsAdd-Type-AssemblySystem.Drawing#Form Details$Form = New-Object System.Windows.Forms.Form -Property @{  Text = 'form' ...

Viewing all articles
Browse latest Browse all 15370

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>