Creating a DocumentWindow
This example provides information on creating document windows in RobotStudio.
Solution
Create empty Control
Control control = new Control();Create DocumentWindow using empty Control
DocumentWindow window = new DocumentWindow(Guid.NewGuid(), control, "MyDocumentWindow"); UIEnvironment.Windows.Add(window);
Example
This example provides information on creating document windows in RobotStudio.
public void AddDocumentWindow()
{
// Begin UndoStep
Project.UndoContext.BeginUndoStep("AddDocumentWindow");
try
{
// Initialize a new control and document window, then add to UI.
Control control = new Control();
DocumentWindow window = new DocumentWindow(Guid.NewGuid(), control, "MyDocumentWindow");
UIEnvironment.Windows.Add(window);
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
}
Required Namespaces
ABB.Robotics.RobotStudio.Environment