title: PowerShell .NET Scrolling in a label
body: <p>After creating a panel I need to add some text to it. To do this I use a <code>Label</code>, and this works great when I know the quantity of text I need to publish. However, at times it's unknown how much characters of text need to be visible in the label. So it would be nice if there was a way to have a scroll-bar in the label, so users can scroll to the end of it if they want to read all of the text.</p>
  
  <p>As you can see below, I tried to do it by setting the <code>AutoSize</code> to <code>$True</code> and a fixed <code>MaximumSize</code>. But this doesn't bring up the necessary scroll-bar..</p>
  
  <p><strong>Label:</strong></p>
  
  <pre><code>$Label = New-Object System.Windows.Forms.Label
  $Label.Location = New-Object System.Drawing.Point(8,26) 
  $Label.MaximumSize = New-Object System.Drawing.Size(528,50)
  $Label.AutoSize = $True
  $Label.Text = "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd STOP"
  #$Label.Text = (Get-Help $MyScript).Description | Out-String 
  $Label.BackColor = 'Transparent'
  $Label.TextAlign = 'TopLeft'
  $Panel.Controls.Add($Label)
  </code></pre>
  
  <p>I found a similar <a href="https://stackoverflow.com/questions/1204804/word-wrap-for-a-label-in-windows-forms">thread</a>, but this only talks about word wrapping and not about scroll-bars.</p>
  
  <p>Thank you for your help.</p>