# Floating ToolWindow error

**URL:** https://tech-community.robotics.abb.com/t/floating-toolwindow-error/3321
**Category:** RobotStudio
**Created:** [January 26, 2010, 12:17pm UTC](https://tech-community.robotics.abb.com/t/floating-toolwindow-error/3321 "2010-01-26T12:17:44Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Kevin](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@Kevin](https://tech-community.robotics.abb.com/u/Kevin)
#### Post date: [January 26, 2010, 12:17pm UTC](https://tech-community.robotics.abb.com/t/floating-toolwindow-error/3321/1 "2010-01-26T12:17:44Z")

</div>

When I run the API Help ‘Add ToolWindow’ example:

[CODE]Project.UndoContext.BeginUndoStep(“AddToolWindow”);

```auto
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");
    tw.Caption = "Tabbed on the left side.";
    UIEnvironment.Windows.AddTabbed(tw, UIEnvironment.Windows["ObjectBrowser"] as ToolWindow);

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

    // Add a floating ToolWindow.
    ToolWindow tw3 = new ToolWindow("MyToolWindow_3");
    tw3.Caption = "Floating ToolWindow.";
    UIEnvironment.Windows.Add(tw3);
}
catch (Exception e)
{
    Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
    throw e;
}
finally
{
    Project.UndoContext.EndUndoStep();
}[/CODE] ... the first two ToolWindows work OK, but the line: [CODE]UIEnvironment.Windows.Add(tw3);
[/CODE] gives this error:

If I click 'Close' the floating ToolWindow appears OK.

I do not know what is meant by 'user defined breakpoint'.

Can anyone replicate this behaviour?

Thanks,

Kevin

```

---

<div class="post-metadata">

### Author: ![Johannes\_Weiman\_old\_account](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/johannes_weiman_old_account/32/3345_2.png) [@Johannes\_Weiman\_old\_account](https://tech-community.robotics.abb.com/u/Johannes_Weiman_old_account)
#### Post date: [January 26, 2010, 6:06pm UTC](https://tech-community.robotics.abb.com/t/floating-toolwindow-error/3321/2 "2010-01-26T18:06:54Z")

</div>

Hi Kevin,

I could reproduce this, there is a (unnecessary) call to Debug.Break() which really shouldn’t have been in a release build.. The workaround is to add the window docked, then float it.

` UIEnvironment.Windows.AddDocked(tw3, DockStyle.Right);
tw3.Float();`  
regards,  
Johannes

---

<div class="post-metadata">

### Author: ![Kevin](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@Kevin](https://tech-community.robotics.abb.com/u/Kevin)
#### Post date: [January 27, 2010, 9:30am UTC](https://tech-community.robotics.abb.com/t/floating-toolwindow-error/3321/3 "2010-01-27T09:30:20Z")

</div>

Thanks Johannes,

That works OK.

Regards,

Kevin
