Hi, I am using ultratoolbarsmanager toolbase to create new buttons. I am wondering how I can check those button keys after inilization. Thanks
this.ultraToolbarsManager1.Tools.AddRange(new ToolBase[]
{new ButtonTool("DismissTask"),
new ButtonTool("DisableAlert"),
ew ButtonTool("DesktopAlertSettings"),
});
Hi Yang,
You can check the ButtonTool keys by accessing the root tools collection of the UltraToolbarsManager, either accessing the index position of the tool or by using the buttonTool’s key that you designated during initialization of that ButtonTool object.
I would be glad to provide a more tailored approach if you provide more information regarding your scenario, but for now, I have provided the following code snippet which will generate a MessageBox after initialization, which will display a string containing all of the ButtonTool keys within that collection.
void Form1_Load(object sender, EventArgs e) { ButtonTool buttonTool1 = new ButtonTool("buttonTool1"); ButtonTool buttonTool2 = new ButtonTool("buttonTool2"); ButtonTool buttonTool3 = new ButtonTool("buttonTool3");
//ultraToolbarsManager1.Tools.AddRange(new ToolBase[] {buttonTool1, buttonTool2, buttonTool3});
ultraToolbarsManager1.Tools.AddRange(new ToolBase[] {new ButtonTool("DismissTask"), new ButtonTool("DisableAlert"), new ButtonTool("DesktopAlertSettings") });
string toolNames = "";
foreach (ButtonTool tool in ultraToolbarsManager1.Tools) { toolNames += tool.Key.ToString() + " "; }
MessageBox.Show(toolNames); }
If you have any further questions regarding this behavior, please let me know.
Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support