QuickOPC User's Guide and Reference
ShowDialog Method (_OpcServerDialog)
Example 



OpcLabs.EasyOpcForms Assembly > OpcLabs.EasyOpc.Forms.Browsing.ComTypes Namespace > _OpcServerDialog Interface : ShowDialog Method
Syntax
'Declaration
 
Function ShowDialog( _
   Optional ByVal owner As IWin32Window _
) As DialogResult
'Usage
 
Dim instance As _OpcServerDialog
Dim owner As IWin32Window
Dim value As DialogResult
 
value = instance.ShowDialog(owner)

Parameters

owner
Example

COM

// This example shows how to let the user browse for an OPC "Classic" server.

class procedure ShowDialog.Main;
var
  ServerDialog: OpcLabs_EasyOpcForms_TLB._OpcServerDialog;
begin
  // Instantiate the dialog object
  ServerDialog := CoOpcServerDialog.Create;

  ServerDialog.ShowDialog(nil);

  // Display results
  WriteLn(ServerDialog.ServerElement.ToString);
end;
Rem This example shows how to let the user browse for an OPC "Classic" server.

Private Sub ShowDialog_Main_Command_Click()
    OutputText = ""

    ' Instantiate the dialog object
    Dim serverDialog As New OpcServerDialog
    Dim DialogResult
    DialogResult = serverDialog.ShowDialog
    
    OutputText = OutputText & DialogResult & vbCrLf
    If DialogResult <> 1 Then   ' OK
        Exit Sub
    End If
    
    ' Display results
    OutputText = OutputText & serverDialog.ServerElement & vbCrLf
End Sub
Rem This example shows how to let the user browse for an OPC "Classic" server.

Option Explicit

Const DialogResult_OK = 1

Dim ServerDialog: Set ServerDialog = CreateObject("OpcLabs.EasyOpc.Forms.Browsing.OpcServerDialog")
'ServerDialog.Location = ""
Dim dialogResult: dialogResult = ServerDialog.ShowDialog
WScript.Echo dialogResult

If dialogResult <> DialogResult_OK Then
    WScript.Quit
End If

' Display results
WScript.Echo ServerDialog.ServerElement
Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also