gorf24
New member
- Joined
- Apr 24, 2022
- Messages
- 2
- Programming Experience
- 1-3
have a form with a textbox and set to multi lines i am sending the datetime and a line read from the serial port..
i have a new line sent also but the text in the textbox never seems to get the newline and scroll down, always over writes the line in the textbox.
any suggestions?
Thanks gary
i have a new line sent also but the text in the textbox never seems to get the newline and scroll down, always over writes the line in the textbox.
any suggestions?
C#:
private void ComPort_DataReceived(object sender, SerialDataReceivedEventArgs e)
{
in_data = "";
in_data = ComPort.ReadLine();
this.Invoke(new EventHandler(displaydata_event));
}
private void displaydata_event(object sender, EventArgs e)
{
dateTime = DateTime.Now;
string time = dateTime.Hour + ":" + dateTime.Minute + ":" + dateTime.Second;
data_in.Text = time + "\t\t\t" + in_data + "\n";
}
Thanks gary
Last edited by a moderator: