PowerShell Studio WebBrowser ProgressBarOverlay

398 views Asked by At

I'm creating a web browser in PowerShell Studio, which works with no issues. I'm trying to use a loading bar when using the search functionality, but it has been to no avail. Below is what my browser looks like. The ideas is to only show the loading bar (using the marquee animation) only while it's loading. enter image description here

This is what I currently have for the loading functionality:

$Search_Click={
    #TODO: Place custom script here
    $url = $txtSearch.Text
    $webbrowser1.Navigate($url)

    while ($webbrowser1.IsBusy)
    {
        $loadingBar.MarqueeAnimationSpeed(50)
        $loadingBar.Visible = $true
    }
}

Below is how I have the loading bar setup in the designer. enter image description here

1

There are 1 answers

0
ArcSet On

If you cant see the progress bar try to bring it to front using

$progressBar.BringToFront()

If you need to set the style as Marquee

$progressBar = New-Object System.Windows.Forms.ProgressBar
$progressBar.Width = 389
$progressBar.Height = 20
$progressBar.Location = new-object system.drawing.point(5,51)
$progressBar.Style = [System.Windows.Forms.ProgressBarStyle]::Marquee
$Form.controls.Add($progressBar)