OPC Studio User's Guide and Reference
ShowDialog Method (_OpcBrowseDialog)
Example 



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

Parameters

owner
Example

.NET

COM

// This example shows how to let the user browse for an OPC Data Access node in a dialog.
//
// Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

using System.Windows.Forms;
using OpcLabs.EasyOpc.Forms.Browsing;

namespace FormsDocExamples._OpcBrowseDialog
{
    static class ShowDialog
    {
        public static void Main1(IWin32Window owner)
        {
            var browseDialog = new OpcBrowseDialog();

            DialogResult dialogResult = browseDialog.ShowDialog(owner);
            if (dialogResult != DialogResult.OK)
                return;

            // Display results
            MessageBox.Show(owner, browseDialog.Outputs.CurrentNodeElement.DANodeElement);
        }
    }
}
# This example shows how to let the user browse for an OPC Data Access node in a dialog.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

# The path below assumes that the current directory is [ProductDir]/Examples-NET/PowerShell/Windows .
Add-Type -Path "../../../Components/Opclabs.QuickOpc/net472/OpcLabs.EasyOpcForms.dll"

$browseDialog = New-Object OpcLabs.EasyOpc.Forms.Browsing.OpcBrowseDialog

$dialogResult = $browseDialog.ShowDialog()
if ($dialogResult -ne [System.Windows.Forms.DialogResult]::OK) {
    return
}

# Display results
Write-Host $browseDialog.Outputs.CurrentNodeElement.DANodeElement
# This example shows how to let the user browse for an OPC Data Access node in a dialog.
#
# Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .
# OPC client and subscriber examples in Python on GitHub: https://github.com/OPCLabs/Examples-QuickOPC-Python .
# The QuickOPC package is needed. Install it using "pip install opclabs_quickopc".
import opclabs_quickopc

# Import .NET namespaces.
from System.Windows.Forms import *
from OpcLabs.EasyOpc.Forms.Browsing import *


browseDialog = OpcBrowseDialog()

dialogResult = browseDialog.ShowDialog()
print(dialogResult)
if dialogResult != DialogResult.OK:
    exit()

# Display results.
print('DANodeElement: ', browseDialog.Outputs.CurrentNodeElement.DANodeElement, sep='')
' This example shows how to let the user browse for an OPC Data Access node in a dialog.
'
' Find all latest examples here: https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

Imports OpcLabs.EasyOpc.Forms.Browsing

Namespace FormsDocExamples._OpcBrowseDialog
    Friend Class ShowDialog
        Shared Sub Main1(owner As IWin32Window)
            Dim browseDialog = New OpcBrowseDialog()

            Dim dialogResult As DialogResult = browseDialog.ShowDialog(owner)
            If dialogResult <> DialogResult.OK Then
                Return
            End If

            ' Display results
            MessageBox.Show(owner, browseDialog.Outputs.CurrentNodeElement.DANodeElement)
        End Sub
    End Class
End Namespace
// This example shows how to let the user browse for an OPC Data Access node.
//
// Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

class procedure ShowDialog.Main;
var
  BrowseDialog: OpcLabs_EasyOpcForms_TLB._OpcBrowseDialog;
begin
  // Instantiate the dialog object
  BrowseDialog := CoOpcBrowseDialog.Create;

  BrowseDialog.ShowDialog(nil);

  // Display results
  WriteLn(BrowseDialog.Outputs.CurrentNodeElement.DANodeElement.ToString);
end;
Rem This example shows how to let the user browse for an OPC Data Access node.
Rem
Rem Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

Private Sub ShowDialog_Main_Command_Click()
    OutputText = ""

    ' Instantiate the dialog object
    Dim browseDialog As New OpcBrowseDialog
    Dim DialogResult
    DialogResult = browseDialog.ShowDialog
    
    OutputText = OutputText & DialogResult & vbCrLf
    If DialogResult <> 1 Then   ' OK
        Exit Sub
    End If
    
    ' Display results
    OutputText = OutputText & browseDialog.Outputs.CurrentNodeElement.DANodeElement & vbCrLf
End Sub
Rem This example shows how to let the user browse for an OPC Data Access node.
Rem
Rem Find all latest examples here : https://opclabs.doc-that.com/files/onlinedocs/OPCLabs-OpcStudio/Latest/examples.html .

Option Explicit

Const DialogResult_OK = 1

Dim BrowseDialog: Set BrowseDialog = CreateObject("OpcLabs.EasyOpc.Forms.Browsing.OpcBrowseDialog")
Dim dialogResult: dialogResult = BrowseDialog.ShowDialog
WScript.Echo dialogResult

If dialogResult <> DialogResult_OK Then
    WScript.Quit
End If

' Display results
WScript.Echo BrowseDialog.Outputs.CurrentNodeElement.DANodeElement
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