32 or 64 bit version of product: 64 bit
Operating system: Win Srv 2008 R2
32 or 64 bit OS: 64 bit
PowerShell Version: 4.0
I've added the same ContextMenuStrip that only contains one menu item called 'Copy' to 2 different labels. When I right click the labels the menu pops-up correctly showing the option 'Copy'. What I'm now struggling with is have it copy the text from the selected label into memory. So it should be aware which label was clicked an depending on that copy the correct label content.
The code below demonstrates what I want it to do. However, it doesn't work with the method 'Focused'.
- $ToolStripMenuItemCopy_Click = {
- if ($labelEmail.Focused) {
- Write-Host "Selected email"
- }
- elseif ($labelSerialNumber.Focused) {
- Write-Host "Selected SerialNumber"
- }
- }
Thank you for your help.