// 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 .
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