To create a new menu item in the action item you can use the below code.
Add the below code in the Form_Load
//create a new
button tool for UltraWinToolbars
Infragistics.Win.UltraWinToolbars.ButtonTool NewTool = new Infragistics.Win.UltraWinToolbars.ButtonTool("NewItem");
// set the
Properties of the new menu
NewTool.SharedProps.Caption = " New Item ";
NewTool.SharedProps.Enabled = true;
NewTool.SharedProps.Visible = true;
NewTool.SharedProps.AppearancesSmall.Appearance.Image
= System.Drawing.Bitmap.FromHicon(SystemIcons.Application.Handle);
baseToolbarsManager.Tools.Add(NewTool);
// add the new
created button tool to Action Menu
((Infragistics.Win.UltraWinToolbars.PopupMenuTool)baseToolbarsManager.Tools["ActionsMenu"]).Tools.Add(NewTool);
// create the
Tool clik method of your created tool
NewTool.ToolClick += new Infragistics.Win.UltraWinToolbars.ToolClickEventHandler(NewTool_ToolClick);
Then add the following event handler
in the code editor
private void NewTool_ToolClick(object
sender,Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
{
// Add your action Here
}
That was working fine thanks.
ReplyDeleteBut what about toolbars added to a dashboard ?
I added a new sheet linked to a dashboard, and selected the option to see the tools menu. I would like to add my own tool icon to click in order to perform some actions related to the dashboard results...on user demand...and not on dashboard update, because it takes a long time to view....
So Is it possible to add my own image button on that toolbar?
Also, that DB has a tracker panel. during design, I noticed I was able to go into customization, and was able to add a button. But at run time, the button was not visible....Am I missing something? Or this is normal?....
Thansk
Actually, you can add items to the menu in the dashboard as action items and then you will write BPM in your BAQ itself to and I will record a video for that soon.
DeleteWaleed
ReplyDeleteThanks for this post and all the others you have offered to the community. I do have an add on question however. Adding the item on the action menu worked GREAT. How would we add a sub menu under the action menu so it would be action->new sub menu->new menu button 1. Thanks for any insight you can offer.
Thanks for your nice words.
DeleteYou can add a sub menu under actions menu as below:
// Create a PopupMenuTool.
PopupMenuTool subMenu = new PopupMenuTool("SubMenu");
// Set some properties on the Popup menu (Optional)
subMenu.AllowTearaway = true;
subMenu.SharedProps.Caption = "Sub Menu 1";
// Always add new tools to the UltraToolbarManager's root tools collection
// before adding them to menus or toolbars.
baseToolbarsManager.Tools.Add(subMenu);
//Add the popup menu to "ActionsMenu"
((PopupMenuTool)baseToolbarsManager.Tools["ActionsMenu"]).Tools.AddTool("SubMenu");
// Create a button Tool
ButtonTool button = new ButtonTool("button");
//Set the properties
button.SharedProps.Caption = "button";
button.SharedProps.Enabled = true;
button.SharedProps.Visible = true;
// Always add new tools to the UltraToolbarManager's root tools collection
// before adding them to menus or toolbars.
this.baseToolbarsManager.Tools.Add(button);
//Add the button tool to the sub menu named ""
subMenu.Tools.Add(button);
Hope this will help you.
Really Nice.....
ReplyDeleteThat was working fine thanks.
Hi Waleed,
ReplyDeletewe use Vantage 8. Can you help me out with the following question.
In the sub menu under the actions menu (In AR Invoice entry > Action > Group) there are four different options.
But all of them have the same image. The images are little squares with a tiny egg-timer below the left corner.
I can't remember the image name now but maybe you know it.
One of the four options is Print Invoices. Do you know how I can disable that option through vb net code?
I know how to disable an item directly under the Action menu,
but not if it's under the sub menu and I can't find the tool's name as a being a member of the baseToolbarsmanager.
And if I could find it I think I can't disable the item because all four options would be disabled because all of them have the same tool image.
Any help would be very appreciated,
Regards,
Pokey!
Any solution to above question?
DeleteThanks for valuable hint.
ReplyDeleteCan you expand this further with an example?
Assume am on sales order. And i want to print sales order with custom BAQ report.
How will i print that opened order with action menu print option?
Am not guru in coding. Am learning and in my company we have epicor.
Your example will be very valuable.
Regards
Thank a lot .It's helpful for me.
ReplyDeleteHi ,
ReplyDeleteThanks for the post,is it possible to hide performa invoice from action menu in SO entry.how can we know the key id.
Thanks
Hi,
ReplyDeleteI am not able to set icon on button tool? what could be the reason?
I tried two ways:
First:
NewTool.SharedProps.AppearancesSmall.Appearance.Image = System.Drawing.Bitmap.FromHicon(SystemIcons.Application.Handle);
Second:
NewTool.SharedProps.AppearancesSmall.Appearance.Image =
EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("Print")];
using Erp.UI;
DeleteHello Waleed,
ReplyDeleteI am trying to hide one of the menu items from the menu,
baseToolbarsManager.Tools["ItemTool"].SharedProps.Visible = false; works great for the top menu.
But how do I remove it from the Right-Click list of menu items when the user rightclicks on a grey area of the form. ?
thanks
Pierre
@Index InfoTech and future googlers that stumble across this post, you'll need a "using System.Drawing to access "System.Drawing.Bitmap.FromHicon(SystemIcons.Application.Handle)". I haven't been able to manage EpiUIImages in E10.
ReplyDelete@IndexInfoTech and future googlers of this post, add "using System.Drawing;" to access "System.Drawing.Bitmap.FromHicon(SystemIcons.Application.Handle);"
ReplyDeleteI haven't managed to grab EpiUIImages yet from E10.