Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

Form and Progressbar

$
0
0

Question 1:

I created a form. After click button on it to run script, the form cannot be dragged or moved until the script finished. Is there a way to move the form around while script running?

$Form = New-Object System.Windows.Forms.Form   
$Form.Size = New-Object System.Drawing.Size(370,340) 
$Form.StartPosition = "CenterScreen"

Question 2:

I added a progressbar on the form. It shows by default as green. I would like to be other color, blue & textbox like, but it is still green (on windows 7):

$ProgressBar1 = New-Object System.Windows.Forms.ProgressBar
$ProgressBar1.Location = new-object System.Drawing.Point(36, 245)
$ProgressBar1.Size = New-Object System.Drawing.Size(285, 20)
$ProgressBar1.ForeColor = 'Blue'
$Form.Controls.Add($ProgressBar1)


Viewing all articles
Browse latest Browse all 21975

Trending Articles



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