For using the Terminal Emulator components the main tasks are:

 

Drop a Tn3270 or Tn5250 Component on your form.
Drop to your form the following components: Display, StatusBar and Keyboard.
Set the Telnet property for Emulator and StatusBar components to the telnet component (Tn3270 or Tn5250). You can set it at run-time using the following code in the Load or Create event of the form:

 

 VB:

 Private Sub Form_Load()

   TNBXDisplay1.TelnetControl = TNB3270X1

   TNBXStatusBar1.TelnetControl = TNB3270X1

   ...

 End Sub

 

 Delphi:

 procedure TForm1.Load(Sender:TObject);

 begin

   tnbEmulator.TnbCom := tnb32701;

   tnbStatusBar.TnbCom := tnb32701;

   ...

 end;

 

Set the EmulatorComponent property from StatusBar component to the Display dropped in the form.

 

 VB:

          TNBXStatusBar1.EmulatorControl = TNBXAidHook1

 

 Delphi:

          tnbStatusBar.TnbEmulator := tnbDisplay1;

 

Set KeyboardComponent property from Emulator component to the Keyboard dropped in the form.

 

 VB:

   TNBXEmulator1.AidHookControl = TNBXAidHook1

 

 Delphi:

          tnbEmulator.TnbAidHook = tnbAidHook1;

 

Now, all what you have to do is fill in the Host property for the Telnet component chosen, with your Mainframe DNS name or TCP/IP address and execute the Connect method. For example:

 

 VB:

 Private Sub Button1_Click()

   'In the edit box you have to type the DNS name or

   'TCP/IP address of the mainframe you want to connect to.

   TNB3270X1.Host = Edit1.Text

   TNB3270X1.Connect()

   ...

 End Sub

 

 Delphi:

 procedure TForm1.Button1Click(Sender:TObject);

       begin

   // In the edit box you have to type the DNS name or

   // TCP/IP address of the mainframe you want to connect to.

   tnb3270.Host := Edit1.Text;

   tnb3270.Connect;

   ...

 end;

 

Now you have a complete terminal emulator.