1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
|
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
$FormA = New-Object System.Windows.Forms.Form
$FormA.Size = New-Object System.Drawing.Size(300,300)
$TextBox1 = New-Object System.Windows.Forms.TextBox
$TextBox1.Location = New-Object System.Drawing.Point(10,10)
$FormA.Controls.Add($TextBox1)
$Button = New-Object System.Windows.Forms.Button
$Button.Location = New-Object System.Drawing.Point(10,50)
$Button.Text = "Suivant"
$FormA.Controls.Add($Button)
$Button.Add_Click({
$Script:Texte = $TextBox1.Text
$FormA.Close()
})
$FormA.Add_Shown({ $FormA.Activate() })
[void] $FormA.ShowDialog()
$FormB = New-Object System.Windows.Forms.Form
$FormB.Size = New-Object System.Drawing.Size(300,300)
$TextBox2 = New-Object System.Windows.Forms.TextBox
$TextBox2.Location = New-Object System.Drawing.Point(10,10)
$TextBox2.Text = $Texte
$FormB.Controls.Add($TextBox2)
$FormB.Add_Shown({ $FormB.Activate() })
[void] $FormB.ShowDialog() |