@Bandi.......thnk's first of all,but i wan to display the mystring in textbox,but your above function return textbox.append
i wan only to display the upcoming output as textbox.text(mystring);
public delegate void AddDataDelegate(String myString);
public AddDataDelegate myDelegate;
private void Form1_Load(object sender, EventArgs e)
{
//...
this.myDelegate = new AddDataDelegate(AddDataMethod);
}
public void AddDataMethod(String myString)
{
textbox1.AppendText(myStrin g);
}
private void mySerialPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
SerialPort sp = (SerialPort)sender;
string s= sp.ReadExisting();
textbox1.Invoke(this.myDelegate, new Object[] {s});
}
Sudhakar_A, if this helps please login to Mark As Answer. | Alert Moderator