In OPC Data Client “Classic” and OPC Data Client-UA, you instantiate a user interface object in Windows Forms applications by dragging the appropriate component from the Toolbox to the designer surface. The designer creates code that instantiates the component, assigns a reference to it to a field in the parent component, and sets its properties as necessary. You can then use designer’s features such as the Properties grid to manipulate the component.
If the needed components do not show in the Toolbox: See Troubleshooting the Visual Studio Extension.
You can, of course, instantiate the user interface objects from your code as well, by calling the appropriate constructors.
In OPC Data Client-COM and OPC Data Client-UA for COM, you can use some of the user interface objects (namely, the dialogs – but not the controls) as well. Create the objects as any other OPC Data Client objects on the COM platforms. The convention described earlier (with computational objects) always applies, and therefore the ProgIDs of the user interface objects are the same as the namespace-qualified names of corresponding .NET types.
In runtime, all user interface features (such as controls, dialogs, and live binding; Windows Forms and WPF) and nonvisual components are supported both under .NET Framework and .NET 6+. However, "designing" them (this includes tasks like dragging from the Toolbox, or configuring in Properties window) in Visual Studio is only possible in .NET Framework projects. In order to achieve visual design for .NET 6+ projects, the developer can make two project files over the same set of source files, one targeting .NET Framework and one targeting .NET 6+, and use the project that targets .NET Framework for visual design tasks. |
The following examples instantiate the user interface objects directly in the code.