Creating Custom Sub Options on Toolbar Buttons

Is there a way to add an option to the “New” button? For example, New Parent, New Child and “New Custom Option”. I can add options to standard tools like File, Edit, and Actions menus, but I can’t do it as a submenu under the “New” button.

1 Like

I’ve never done that specifically. It is fairly easy to add new tools to the toolbars, so I would imagine that it’s possible.

It was easier than I thought. By using the code available on the internet, we just need to add our new option to ‘NewMenuTool.’"

ButtonTool matPrima = new ButtonTool("matPrima");
	    //
	    matPrima.SharedProps.Caption = "Nueva Mat Prima";
	    matPrima.SharedProps.Enabled = true;
	    matPrima.SharedProps.Visible = true;
	    matPrima.SharedProps.AppearancesSmall.Appearance.Image =
	          EpiUIImages.SmallEnabledImages.Images[EpiUIImages.IndexOf("New")];
	    // 
	    baseToolbarsManager.Tools.Add(matPrima);		   
	    // 
        ((PopupMenuTool)baseToolbarsManager.Tools["NewMenuTool"]).Tools.AddTool("matPrima");


private void baseToolbarsManager_ToolClick(object sender, Infragistics.Win.UltraWinToolbars.ToolClickEventArgs args)
	{
		switch(args.Tool.Key)
		{			
			case "matPrima":
				MessageBox.Show("Hello world!");
				break;
		}
	}

new option

2 Likes