Show / Hide Table of Contents

Creating a ToolWindow

This example provides information on creating ToolWindows and dock them in different places in RobotStudio.

Solution

  1. Create a ToolWindow

    ToolWindow tw = new ToolWindow("MyToolWindow_1");
    
  2. Add the ToolWindow as a tab next to the ObjectBrowser using AddTabbed(ToolWindow, ToolWindow)

    UIEnvironment.Windows.AddTabbed(tw, UIEnvironment.Windows["ObjectBrowser"] as ToolWindow);
    tw.Caption = "Tabbed on the left side.";
    
  3. Add a ToolWindow docked on the right side using AddDockedOrTabbed(ToolWindow, DockStyle)

    ToolWindow tw2 = new ToolWindow("MyToolWindow_2");
    UIEnvironment.Windows.AddDockedOrTabbed(tw2, DockStyle.Right);
    tw2.Caption = "Docked on the right side.";
    
  4. Add a floating ToolWindow using Add(Window)

    ToolWindow tw3 = new ToolWindow("MyToolWindow_3");
    UIEnvironment.Windows.Add(tw3);
    tw3.Caption = "Floating ToolWindow.";
    
  5. Add a ToolWindow with respect to another ToolWindow

    ToolWindow tw4 = new ToolWindow("MyToolWindow_4");
    UIEnvironment.Windows.AddTabbed(tw4, tw);
    tw4.Caption = "Reference ToolWindow.";
    

Example

This example provides information on creating ToolWindows in RobotStudio.

Project.UndoContext.BeginUndoStep("AddToolWindow");
try
{
    // How to create a ToolWindow and dock it in different places.
    // Add it tabbed on the left side.
    ToolWindow tw = new ToolWindow("MyToolWindow_1");
    UIEnvironment.Windows.AddTabbed(tw, UIEnvironment.Windows["ObjectBrowser"] as ToolWindow);
    tw.Caption = "Tabbed on the left side.";

    // Add it docked on the right side.
    ToolWindow tw2 = new ToolWindow("MyToolWindow_2");
    UIEnvironment.Windows.AddDockedOrTabbed(tw2, DockStyle.Right);
    tw2.Caption = "Docked on the right side.";

    // Add a floating ToolWindow.
    ToolWindow tw3 = new ToolWindow("MyToolWindow_3");
    UIEnvironment.Windows.Add(tw3);
    tw3.Caption = "Floating ToolWindow.";

    // Add ToolWindow with respect to tw.
    ToolWindow tw4 = new ToolWindow("MyToolWindow_4");
    UIEnvironment.Windows.AddTabbed(tw4, tw);
    tw4.Caption = "Reference ToolWindow.";
}
catch
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw;
}
finally
{
    Project.UndoContext.EndUndoStep();
}

Required Namespaces

ABB.Robotics.RobotStudio.Environment

See Also

  • Creating DocumentWindow
In this article
Back to top Copyright © 2025 ABB