API Reference

Detailed and full API reference helps you master Tekla development

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

MainWindow Class

The MainWindow class is a class for binding the .NET dialogs under the Tekla Structures main window.
Inheritance Hierarchy

Namespace:  Tekla.Structures.Dialog
Assembly:  Tekla.Structures.Dialog (in Tekla.Structures.Dialog.dll) Version: 2020.0.0.0 (2020.0.55582.0)
public class MainWindow : IWin32Window

The MainWindow type exposes the following members.

  Name Description
Public property Handle
Gets the handle.
  Name Description
Public method AddExternalWindow
Registers the entire dialog to be insensitive at certain points, for example while modal Tekla Structures system dialog boxes are open. When insensitive, the dialog does not respond to any input. You can remove the registration of the dialog with RemoveExternalWindow(String, IntPtr).
Public method RemoveExternalWindow
Removes a registration done with AddExternalWindow(String, IntPtr).
  Name Description
Public fieldStatic member Frame
The main Tekla Structures window.
This example shows how to use the AddExternalWindow(String, IntPtr) method to register a dialog to be insensitive while certain Tekla Structures modal dialogs are open. Unregistering is done similarly using the RemoveExternalWindow(String, IntPtr) method.
using System;
using Tekla.Structures.Dialog;
using Tekla.Structures.Model;

public partial class Form1 : FormBase
       // Handles the form load event.
       protected override void OnLoad(EventArgs e)
           MainWindow.Frame.AddExternalWindow(this.Name, this.Handle);

       // Handles the form closed event.
       protected override void OnClosed(EventArgs e)
           MainWindow.Frame.RemoveExternalWindow(this.Name, this.Handle);
See Also