Altova StyleVision 2024 Professional Edition

Property: Toolbars as Commands (read-only)

 

Dispatch Id: 1005

 

Description:

This property provides information about the structure of StyleVisionControl toolbars, as a Command object. The Command object contains all available toolbars of StyleVision. 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 GetStyleVisionToolbars()
{
   // Get the application toolbars from the StyleVision ActiveX control assigned to the current form      
   StyleVisionControlLib.StyleVisionCommands toolbars = this.axStyleVisionControl1.Toolbars;
 
   // Iterate through all toolbars    
   for (int i = 0; i < toolbars.Count; i++)
   {
     StyleVisionControlLib.StyleVisionCommand 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++)
     {
        StyleVisionControlLib.StyleVisionCommand 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