Just wondering if it is possible to have a “floating” tool window in RobotStudio. The tool window controls are designed through a UserControl. I have tried the following code, using VS 2005:
public static void AddinMain()
{
ToolWindow tw = new ToolWindow();’
UserControl1 uc = new UserControl1()
tw.Control = uc;
if you want to have a floating ToolWindow just call Windows.Add instead:
public static void AddinMain()
{
ToolWindow tw = new ToolWindow();
tw.Caption = “MyFloatingToolwindow”;
Button b = new Button();
b.Text = “ClickMe”;
b.Size = new Size(100, 100);
tw.Control = b; &nbs p;
UIEnvironment.Windows.Add(tw);
}
The reason you got an exception was that the method Windows.AddDocked() does not support DockStyle.None, because it means that the window is not docked. I will update the exception message text to be more descriptive.