RobotStudio API - ToolWindow DockStyle
neil
✭
in RobotStudio
Hi,
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;
UIEnvironment.Windows.AddDocked(tw, DockStyle.None);
}
When RobotStudio starts up the following message appears in the RS ouput window:
"Value does not fall within the expected range"
and the addin does not load. The same happens if I use DockStyle.Fill
Changing the DockStyle property to "Dockstyle.Right", the add in loads up with no error.
Thanks in advance,
Neil
neil2008-2-11 15:49:2
0
Comments
-
Hi Neil,<?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />
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.
0 -
I tried this example and after starting my Add-In a message box pops up with the information "RobotStudio has encountered a user-defined breakpoint."After clicking "Close" the Add-In is loaded and the toolWindow is visible.The Debugger stops at the last line of the code snippet (UIEnvironment.Windows.Add(tw);)Does anybody know how to fix that problem?Thank you,Bernd0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 786 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings