Trying to access a toolbar click even through this line of code in 10.2.700.
Added
using Infragistics.Win.UltraWinGrid;
using System.Collections.Generic;
public void ToolBarClick(string tool)
{
MainController.AppControlPanel.HandleToolClick(tool, new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MainController.MainToolManager.Tools[tool], null));
}
Keeps kicking out this error though.
The name ‘MainController’ does not exist in the current context
This is in 10.2.700. Did the syntax change for this possibly?
Can’t be because the MainController is the Form name… for example in the Part Form it would be PartForm and in the Quote Form it will be QuoteForm or QuoteFormEntry – can’t recall.
The only way I know how to perform the click of the button is by using reflection
// Example of MasterPackPrintForm - you would change that to QuoteForm
MethodInfo mi = typeof(EpiBaseForm).GetMethod("handleToolClick", BindingFlags.Instance | BindingFlags.NonPublic);
mi.Invoke(MasterPackPrintForm, new object[]{"PrintClientTool",new Infragistics.Win.UltraWinToolbars.ToolClickEventArgs(MasterPackPrintForm.MainToolManager.Tools["RefreshTool"],null)});
OR
// Kind of Cheating, does not seem to work in MES, but works in Dashboards and Epicor
baseToolbarsManager.Tools["RefreshTool"].SharedProps.Shortcut = (Shortcut)Shortcut.ShiftF9;
SendKeys.Send("+{F9}");
But rarely is it being used since you can always invoke stuff with