Altova XMLSpy 2025 Enterprise Edition 

Property: Toolbars as Commands (read-only)

 

Dispatch Id: 1005

 

Description:

This property provides information about the structure of XMLSpyControl toolbars, as a Command object. The Command object contains all available toolbars of XMLSpy. To access the toolbars, use the SubCommands property of the Toolbars property. Each toolbar is also a Command object. For each toolbar, you can then further iterate through their SubCommands property in order to get their commands (this technique may be used, for example, to create the application's toolbars programmatically).

 

 

public void GetXmlSpyToolbars()
{
   // Get the application toolbars from the StyleVision ActiveX control assigned to the current form      
   XMLSpyControlLib.XMLSpyCommands toolbars = this.axXMLSpyControl1.Toolbars;
 
   // Iterate through all toolbars
   for (int i = 0; i < toolbars.Count; i++)
   {
     XMLSpyControlLib.XMLSpyCommand toolbar = toolbars[i];
     Console.WriteLine();
     Console.WriteLine("The toolbar \"{0}\" has the following commands:", toolbar.Label);
 
     // Iterate through all commands of this toolbar
     for (int j = 0; j < toolbar.SubCommands.Count; j++)
     {
        XMLSpyControlLib.XMLSpyCommand cmd = toolbar.SubCommands[j];
        // Output only command objects that are not separators
        if (!cmd.IsSeparator)
        {
           Console.WriteLine("{0}, {1}, {2}", cmd.ID, cmd.Name, cmd.Label.Replace("&", ""));
        }
     }
   }
}

C# example

 

© 2018-2024 Altova GmbH