Using EditFields Collection

Top  Previous  Next

The EditFields collection contain a reference to all the fields in HostFields collection with the unprotected attribute set to true. These fields can be accessed in order to modify its data, which later will be sent to the mainframe along with a function key (AID key).

 

VB.NET

[Field =] tnxxxx.EditFields (Index As Integer)

[Field =] tnxxxx.EditFields (Index As String)

 

C#

[Field =] tnxxxx.EditFields [int index];

[Field =] tnxxxx.EditFields [string index];

 

 VB.NET:

 Private Sub cmdLogin_Click(eventSender As object, eventArgs As System.EventArgs)

        ' this code sets userId in Field located at Row 10 Column 2

    tn3270.EditFields["R10C2"].Data = "puser"

        ' this code sets the password in Field located at Row 12 Column 2

    tn3270.EditFields["R12C2"].Data = "k2156"

        ' this code sends the ENTER Attention Identifier Key along with all modified EditFields

         tn3270.Press("Enter")

 End Sub

 

 C#:

 private void cmdLogin_Click(object eventSender, System.EventArgs eventArgs)

 {

        // this code sets userId in Field located at Row 10 Column 2

    tn3270.EditFields["R10C2"].Data = "puser";

        // this code sets the password in Field located at Row 12 Column 2

    tn3270.EditFields["R12C2"].Data = "k2156";

        // this code sends the ENTER Attention Identifier Key along with all modified EditFields

         tn3270.Press("Enter");

 }