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
Loading
MichaelPosted Apr 30, 2009, 8:35 AM
As you mgiht not have seen it's a thread, so I do invoke to the GUI.
Thanks anyways :)
Niradhip ChakrabortyPosted Apr 30, 2009, 8:21 AM
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.
MichaelPosted Apr 30, 2009, 7:53 AM
Here is the whole form; http://pastebin.com/m67788810
Niradhip ChakrabortyPosted Apr 30, 2009, 7:52 AM
MichaelPosted Apr 30, 2009, 7:42 AM
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 ChakrabortyPosted Apr 30, 2009, 7:27 AM
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