Use the following code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication5
{
class Program
{
static void Main(string[] args)
{
string s = "";
Sample a = new Sample();
a.Refresh(); // re-paint a form
do
{
s = Console.ReadLine();
a.MyText = s;
a.Refresh(); // re-paint a form
} while (s.Length != 0);
}
static void show()
{
}
}
}
class Sample : System.Windows.Forms.Form
{
System.Windows.Forms.TextBox t = new System.Windows.Forms.TextBox();
public Sample()
{
t.Multiline = true;
t.Size = new System.Drawing.Size(100, 100);
Controls.Add(t);
Show();
}
public string MyText
{
get
{
return t.Text;
}
set
{
t.Text = t.Text + "\r" + "\n" + value;
}
}
}
Reputation Points: 2136
Solved Threads: 1228
Posting Genius
Offline 6,527 posts
since Oct 2008