Changing the form's inheritance - SmartPlant Foundation - IM Update 44 - Customization & Programming - Hexagon

SmartPlant Foundation Customization

Language
English
Product
SmartPlant Foundation
Search by Category
Customization & Programming
SmartPlant Foundation / SDx Version
10

To be used like any other form in the Desktop Client (that is, to take advantage of the window management), your form must inherit from SPF.Client.Forms.BaseSystemForm.

When a form is created in Visual Studio, two VB classes are generated. The one you see in your Solution Explorer under the Files tab is where you will place your code. The layout code is hidden in another file in what is called a Partial Class. The Partial Class is just the syntax for splitting a class definition across two files. Unfortunately, the generated Inherits statement is within that hidden file.

To show this file, click Show All Files on the Solution Explorer toolbar, as pictured below.

This will result in something similar to this:

The Partial class is in the file called <FormName>.Designer.vb when the child nodes of the form we created are expanded. When you view the code in this file, you will see the Inherits statement for this form. Change it to

Partial Class DoSomethingGUI

Inherits SPF.Client.Forms.BaseSystemForm

Changing the inheritance of the form is only required if you want to create a modeless form that uses the Desktop Client window management services.