Hello,
The last few days I've been busy trying to write a chat/chat server and so far it's been great, but now, that should be the easiest part, it goes wrong.
The last hour I have been having problems trying to add text to a richtextbox.
The string which I'm trying to add shows up with a messagebox, so it's really this line;
this.richTextBox2.text += data;
I have also tried;
this.richTextBox2.AppendText(data);
this.richTextBox2.text = data;
And any other form that I know of.
Can anyone please help me?
The whole function can be found here: http://pastebin.com/m33337a4c
Richtextbox problem
6 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Niradhip ChakrabortyRank #428 · 5.8K pointsPosted Apr 30, 2009, 3:27 AM EDT
1.http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/1c4cb854-6e32-4d60-be20-bb8ef0218d45
2.http://www.bizsupportonline.net/infopath2007/programmatically-add-text-lines-rich-text-box-infopath-code.htm
3.http://www.codeproject.com/KB/cs/RTFSyntaxColour.aspx
Michael7 pointsPosted Apr 30, 2009, 3:42 AM EDT
I just can't add any text in that function for some odd reason.
In the main function I can add text by simply doing using this.richTextBox2.Text but in that function not =/
Would you like to see the whole form?
Niradhip ChakrabortyRank #428 · 5.8K pointsPosted Apr 30, 2009, 3:52 AM EDT
Michael7 pointsPosted Apr 30, 2009, 3:53 AM EDT
Here is the whole form; http://pastebin.com/m67788810
Niradhip ChakrabortyRank #428 · 5.8K pointsPosted Apr 30, 2009, 4:21 AM EDT
I am not sure whether I understood your problem properly or not.
String Data will give the user name and you want to add his with messagebox text i.e. This username already exists. So all together it comes like this SBUSERNAMESB,This username already exists!; string strmessage = "This username already exists!"; string stremp = data + "," + " " + strmessage ;now append this.
this.richTextBox1.AppendText(stremp);
Note: I didnt get what is this stand for..
"this.richTextBox2.Text but in that function not =/" in your previous post.
Michael7 pointsPosted Apr 30, 2009, 4:35 AM EDT
As you mgiht not have seen it's a thread, so I do invoke to the GUI.
Thanks anyways :)