on 10-08-2007 2:47 PM
Good Morning
Experts:
I have added several options(SAP and Custom) to the Right-Click event. It works as designed when Right-Clicking on the Matrix. However, when Right-Clicking anywhere else on the screen, the options are still displayed.
How can I restrict the options to only be displayed when Right-Clicking on a Matrix?
Thanks,
EJD
Hi,
In right click event,u can block them by code.
if(pVal.ItemUID=="Matrix Id")
{
oForm.EnableMenu("x", true);
}
else
{
oForm.EnableMenu("x", false);
}
x-id of menu
true-if u want to enable
false-if u want to disable menu
Thanks and Regards,
Lalit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Closed too soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ed,
The right click event is completely separate event (ie it is not an EventType within the ItemEvent).
So to code it (C#):
private void _sboApp_RightClickEvent(ref SAPbouiCOM.ContextMenuInfo EventInfo, out bool BubbleEvent)
{
BubbleEvent = true;
if(EventInfo.FormUID == "MYFORM")
{
// Do some stuff
}
}
You also need to have defined the event while initialising the application object:
this._sboApp.RightClickEvent += new SAPbouiCOM._IApplicationEvents_RightClickEventEventHandler(this._sboApp_RightClickEvent);
There's an example project in the UI section of the SDK samples (number 22).
Kind Regards,
Owen
Hi,
You should add code in the before right-click to check if the itemuid is the matrix, and if not add nothing.
Regards
Ad
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
9 | |
9 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.