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: 2023.0.3
Syntax
public class MainWindow : IWin32Window

The MainWindow type exposes the following members.

Properties
  NameDescription
Public propertyHandle
Gets the handle.
Top
Methods
  NameDescription
Public methodAddExternalWindow
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 methodRemoveExternalWindow
Removes a registration done with AddExternalWindow(String, IntPtr).
Top
Fields
  NameDescription
Public fieldStatic memberFrame
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
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next