Visavi Visual OPC .NET  

SelectServerForm Class

Represents a dialog box that allows the user to browse and select an OPC Server that exists on the local machine or network.

For a list of all members of this type, see SelectServerForm Members.

System.Object
   System.MarshalByRefObject
      System.ComponentModel.Component
         System.Windows.Forms.Control
            System.Windows.Forms.ScrollableControl
               System.Windows.Forms.ContainerControl
                  System.Windows.Forms.Form
                     Visavi.Opc.Client.Forms.SelectServerForm

[Visual Basic]
 Public Class SelectServerForm
   Inherits Form
[C#]
 public class SelectServerForm: Form
[C++]
 public __gc class SelectServerForm : public Form
[JScript]
public class SelectServerForm extends Form

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Any instance members are not guaranteed to be thread safe.

Remarks

This class allows you to browse and select an OPC server on the local machine or network. The path to the selected server is specified with the SelectedServer property.

Example

[Visual Basic, C#] The following example uses the SelectServerForm and illustrates creating and showing the dialog box. The example uses the ShowDialog method to display the dialog box and return the DialogResult. The example then displays a MessageBox that displays the selected server.

[Visual Basic] 
Protected Sub button1_Click(sender As Object, e As System.EventArgs)
   Dim selectServerForm As SelectServerForm
   If selectServerForm.ShowDialog() = DialogResult.OK Then
      If Not selectServerForm.SelectedServer = Nothing Then
         MessageBox.Show(Me, selectServerForm.SelectedServer.ToString())
      End If
   End If
End Sub

[C#]
protected void button1_Click(object sender, System.EventArgs e)
{
   SelectServerForm selectServerForm = new SelectServerForm();
   if (selectServerForm.ShowDialog() == DialogResult.OK)
   {
      if (selectServerForm.SelectedServer != null)
      {
         MessageBox.Show(this, selectServerForm.SelectedServer.ToString());
      }
   }
}

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Namespace: Visavi.Opc.Client.Forms

Platforms:  Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows .NET Server family

Assembly: Visavi.Opc.Client.Forms

See Also

SelectServerForm Members | Visavi.Opc.Client.Forms Namespace