title: PowerShell Form, how to refresh Label?
body: <p>I am playing around with forms and am stuck with refreshing information in a  Label.</p>
  
  <p>Trying to refresh either Label or The Form itself did not work.
  <em>The Testcode I wrote:</em></p>
  
  <pre><code>CLS
  
  Add-Type -assembly System.Windows.Forms
  $Counter = 1
  
  $Main_Form = New-Object System.Windows.Forms.Form
  $Main_Form.Icon = $objIcon
  $Main_Form.Text ='Test Test Test'
  $Main_Form.Size = '1000,400'
  $Main_Form.StartPosition = "CenterScreen"
  $Main_Form.AutoSize = $true
  $Main_Form.BringToFront()
  Test
  
  Function Test {
  $Label = New-Object System.Windows.Forms.label
  $Label.Location = '10,20'
  $Label.Size = '200,60'
  $Label.Font = New-Object System.Drawing.Font("Times New Roman",16,[System.Drawing.FontStyle]::Bold)
  $Label.BackColor = "Transparent"
  $Label.ForeColor = "Blue"
  $Label.Text = 'Counter '+$Counter
  $Main_Form.Controls.Add($Label)
  
  $Button = New-Object System.Windows.Forms.Button
  $Button.Location = '50,200'
  $Button.Size = '200,75'
  $Button.Font = New-Object System.Drawing.Font("Arial",16,[System.Drawing.FontStyle]::Bold)
  $Button.Text = 'Next'
  $Main_form.Controls.Add($Button)
  $ButtonClickEvent = ({Write-Host 'Test '$Counter;$Global:Counter++})
  $Button.Add_Click($ButtonClickEvent)
  }
  
  $Main_Form.ShowDialog()
  </code></pre>
  
  <p>When running the code, a window opens and it says Counter 1. Pressing the "Next" button, I would like the Counter to change to Number 2.</p>
  
  <p>For testing purpose, I write Test 1 with adding "+1" each time, when Next is pressed and that seams to work.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Thank you very much for any help,</p>
  
  <p>Mike</p>