Answer the question
In order to leave comments, you need to log in
Powershell. How to assign iFrame to WebBrowser of Forms class?
Good afternoon.
Tricky question for Powershell connoisseurs.
In PS built a form with WebBrowser elements:
Add-Type -AssemblyName System.Windows.Forms
$URL1 = "http://site.com"
# WinForm Setup
$mainForm = New-Object System.Windows.Forms.Form
$mainForm.Font = “Comic Sans MS,9"
$mainForm.ForeColor = [System.Drawing.Color]::White
$mainForm.BackColor = [System.Drawing.Color]::DarkSlateBlue
$mainForm.Text = " System.Windows.Forms.WebBrowser Class"
$mainForm.Width = 960
$mainForm.Height = 750
# Main Browser
$webBrowser1 = New-Object System.Windows.Forms.WebBrowser
$webBrowser1.URL = $URL1
$webBrowser1.Width = 600
$webBrowser1.Height = 600
$webBrowser1.Location = "50, 25"
$mainForm.Controls.Add($webBrowser1)
# First Selectable Browser
$webBrowser2 = New-Object System.Windows.Forms.WebBrowser
$webBrowser2.URL = $URL1
$webBrowser2.Width = 600
$webBrowser2.Height = 50
$webBrowser2.Location = "50, 630"
$mainForm.Controls.Add($webBrowser2)
# Display Form
[void] $mainForm.ShowDialog()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question