title: How to get the sender to mouse-right-click menu in Powershell forms
body: <p>I use Dynamic Labels.
  I need to know on which dynamic label right click was pressed.
  When I double click the server name it writes the label I pressed.
  But how can I get the label I pressed in <code>ContextMenuStrip</code>?</p>
  
  <p>This is the relevant part of my script:</p>
  
  <pre><code>$contextMenuStrip1 = New-Object System.Windows.Forms.ContextMenuStrip
  $Menu1a = $contextMenuStrip1.Items.Add("Item 1")
  $Menu1a.add_Click(
          {   
          param($Sender,$EventArgs) write-host $Sender.name
          Write-Host $this.Text
          })
  $Menu1b = $contextMenuStrip1.Items.Add("Item 2")
  $Menu1b.add_Click({Write-Host $this.Text})
  
  
  $Global:DynLblElemCol1 = foreach($Server in $Servers)
          {
              $Col = New-Object System.Windows.Forms.Label        
              $Col.Size = New-Object System.Drawing.Size(100, 18)
              $col.TextAlign = "MiddleCenter"
              $col.Text = $Server
              $Col.Name = $Server
              $Col.Add_DoubleClick({param($Sender,$EventArgs) write-host $Sender.Text})
              $Col.ContextMenuStrip = $contextMenuStrip1
              $Col
          }
      foreach($item in $DynLblElemCol1)
          {
              $item.Location = New-Object System.Drawing.Point(80, $CheckBoxCounter)
              $Form1.Controls.Add($item)
              $CheckBoxCounter = $item.Bottom + $LineSpace  # increment our counter
          }
  }
  </code></pre>