title: Display String in Windows Forms Textbox
body: <p>I have a string named " <strong>e.RequestMessage.Text</strong> " . In a class this string I want to show has a value int a textbox in a windows form .</p>
  
  <p>I have the project that contains a class which shows my string in a console. So I want to show this sting in a textbox on a windows form. I added a windows form to it (the class runs in front)</p>
  
  <p>How can I accomplish this?</p>
  
  <pre><code>using System;
  using Eneter.Messaging.DataProcessing.Serializing;
  using Eneter.Messaging.EndPoints.TypedMessages;
  using Eneter.Messaging.MessagingSystems.MessagingSystemBase;
  using Eneter.Messaging.MessagingSystems.TcpMessagingSystem;
  using Eneter.ProtoBuf;
  using message.declarations;
  
  namespace ServiceExample
  {
      class Program
      {
          private static IDuplexTypedMessageReceiver&lt;MyResponse, MyRequest&gt; myReceiver;
  
          static void Main(string[] args)
          {
              // Instantiate Protocol Buffer based serializer.
              ISerializer aSerializer = new ProtoBufSerializer();
  
              // Create message receiver receiving 'MyRequest' and receiving 'MyResponse'.
              // The receiver will use Protocol Buffers to serialize/deserialize messages. 
              IDuplexTypedMessagesFactory aReceiverFactory = new DuplexTypedMessagesFactory(aSerializer);
              myReceiver = aReceiverFactory.CreateDuplexTypedMessageReceiver&lt;MyResponse, MyRequest&gt;();
  
              // Subscribe to handle messages.
              myReceiver.MessageReceived += OnMessageReceived;
  
              // Create TCP messaging.
              IMessagingSystemFactory aMessaging = new TcpMessagingSystemFactory();
  
              IDuplexInputChannel anInputChannel
                  = aMessaging.CreateDuplexInputChannel("tcp://127.0.0.1:8060/");
  
              // Attach the input channel and start to listen to messages.
              myReceiver.AttachDuplexInputChannel(anInputChannel);
  
              Console.WriteLine("The service is running. To stop press enter.");
              Console.ReadLine();
  
              // Detach the input channel and stop listening.
              // It releases the thread listening to messages.
              myReceiver.DetachDuplexInputChannel();
          }
  
          // It is called when a message is received.
          private static void OnMessageReceived(object sender, TypedRequestReceivedEventArgs&lt;MyRequest&gt; e)
          {
              Console.WriteLine("Received: " + **e.RequestMessage.Text**);
  
              // Create the response message.
              MyResponse aResponse = new MyResponse();
              aResponse.Length = e.RequestMessage.Text.Length;
  
              // Send the response message back to the client.
              myReceiver.SendResponseMessage(e.ResponseReceiverId, aResponse);
          }
      }
  }
  </code></pre>
  
  <p><strong>Windows form code:</strong></p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  
  namespace ServiceExample
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
          private void Form1_Load(object sender, EventArgs e)
          {
  
          }
      }
  }
  </code></pre>