Hi,
I have a Powershell Studio Form with tabcontrol in the main form.
In the tabcontrol there are several different gridviews (every tab -3 tabs- has one). On one of these gridviews there is a contextmenustrip active, which works fine.
No I needed another contextmenustrip for another gridview in another tab and saw that my contextmenustrip is active wherever I click in the form instead of locked to 1 gridview.
My question:
-how can I lock the contextmenu to 1 gridview in 1 tab (it should only appear there when rightclicking an item in that gridview)?
-how can I add another contextmenu that is 'locked' (appears only) on another gridview (other tab)
-can I hide specifc contexmenuitems for specific users if ($env:username) –eq .. then remove item or disable?
Note: I'm already hiding tabs using $Mytab = $tabcontrolMainForm.TabPages['Mytab']
if ... {$tabcontrolMainForm.TabPages.Remove($Mytab )} which works fine. Is there a similar approach to hide contextmenuitems?
Thanks!
J.
ContextMenu: lock to one gridview (on tabcontrol page) + hide items
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: ContextMenu: lock to one gridview (on tabcontrol page) + hide items
Thanks for your quick reply!
Yes, exactly, but I can't find a way to change the way it is attached now to the gridview.
Also, any idea to hide a control in the context menu strip?
Yes, exactly, but I can't find a way to change the way it is attached now to the gridview.
Also, any idea to hide a control in the context menu strip?
Re: ContextMenu: lock to one gridview (on tabcontrol page) + hide items
Thanks, didn't know there was a property contexmenustrip