1

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

Matt
  • 379
  • 7
  • 18
  • IS the problem that it shows the progress bar but not the marquee? or doesnt show the progress bar at all? – ArcSet Aug 24 '17 at 18:38
  • It does not show the progress bar at all. – Matt Aug 24 '17 at 18:44
  • in your 2nd picture i see the progress bar.... its in the upper right corner at 0% – ArcSet Aug 24 '17 at 18:45
  • Right. That's just how it shows up in the designer. When the GUI is launched, I have it's visibility set to false and then toggle it visible when it needs to be shown. – Matt Aug 24 '17 at 18:50
  • Well it could be behind something or off the page...I need to see more code then that. have you tried .BringToFront() on the progressbar – ArcSet Aug 24 '17 at 18:52
  • did that work for you? – ArcSet Aug 24 '17 at 19:43

1 Answers1

1

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)
ArcSet
  • 6,518
  • 1
  • 20
  • 34