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
SystemObject
  Tekla.Structures.DialogMainWindow

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

The MainWindow type exposes the following members.

Properties
  Name Description
Public property Handle
Gets the handle.
Top
Methods
  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).
Top
Fields
  Name Description
Public fieldStatic member Frame
The main Tekla Structures window.
Top
Examples
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)
       {
           base.OnLoad(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);
           base.OnClosed(e);
       }
}
See Also