InfoConnect API Guide
Attachmate.Reflection.UserControl.OpenSystemsGraphics Namespace / OpenSystemsGraphicsTerminalControl Class / InitInstance Method / InitInstance() Method
Example


In This Topic
    InitInstance() Method
    In This Topic
    Initializes this terminal instance.
    Syntax
    'Declaration
     
    
    Public Overloads Sub InitInstance() 
    'Usage
     
    
    Dim instance As OpenSystemsGraphicsTerminalControl
     
    instance.InitInstance()
    public void InitInstance()
    Remarks

    The InitInstance call is required to initialize the terminal user control prior to use.

    Use the TerminalInitializedEventHandler to check for any errors that may have occurred during terminal initialization.

    Example
    Initialize a terminal user control and then check for errors before setting the host address and connecting
    private void Form1_Load(object sender, EventArgs e)
    {
        openSystemsGraphicsTerminalControl1.InitInstance();
    }
     
    private void openSystemsGraphicsTerminalControl1_TerminalInitializedEvent(object sender, AsyncCompletedEventArgs e)
    {
        // Check if error occurred during the terminal initialization
        if (e.Error != null)
        {
            MessageBox.Show("Error during terminal initialization step: " + e.Error); return;
        }
     
        ITerminal Terminal = openSystemsGraphicsTerminalControl1.Terminal;
        ((IConnectingSettingsBestNetwork)Terminal.ConnectionSettings).HostAddress = "yourHostName";
        Terminal.Connect();
    }
    See Also