Powershell GUI: Adding multiple instances of .tooltipseperate to menu

Posted by obious on Stack Overflow See other posts from Stack Overflow or by obious
Published on 2012-07-08T21:11:25Z Indexed on 2012/07/08 21:15 UTC
Read the original article Hit count: 240

Filed under:
|
|

So, I'm having a problem whereby for some reason I can only add one instance of a .tooltipseperator to a drop down menu. E.g. I have to create a new .tooltipseperator if I want to add another to a different menu list.

I have this:

$seperator = new-object System.Windows.Forms.Toolstripseparator
$seperator1 = new-object System.Windows.Forms.Toolstripseparator

which correlates to this:

[Void]$packages_menu_bar.DropDownItems.Add($seperator1) 
[Void]$packages_menu_bar.DropDownItems.Add($Remove_from_AD)
[Void]$process.DropDownItems.Add($Kill_process)
[Void]$process.DropDownItems.Add($seperator) 

My question is this:

how can I add the same instance on a .tooltipseperater to different menu items? Some sort of array?

Thanks

© Stack Overflow or respective owner

Related posts about .NET

Related posts about arrays