CentralServerDemo.ExRichTextBox.AppendTextAsRtf C# (CSharp) Method

AppendTextAsRtf() public method

Appends the text using the current font, text, and highlight colors.
public AppendTextAsRtf ( string _text ) : void
_text string
return void
        public void AppendTextAsRtf(string _text) {
            AppendTextAsRtf(_text, this.Font);
        }

Same methods

ExRichTextBox::AppendTextAsRtf ( string _text, Font _font ) : void
ExRichTextBox::AppendTextAsRtf ( string _text, Font _font, RtfColor _textColor ) : void
ExRichTextBox::AppendTextAsRtf ( string _text, Font _font, RtfColor _textColor, RtfColor _backColor ) : void

Usage Example

Example #1
0
		private void ics_ConferenceMessageReceived(object sender, string messageReceived, string fromUser)
		{
			Invoke(new MethodInvoker(delegate
			{
				var _rtBox = new ExRichTextBox();
				int _index;


				_rtBox.AppendTextAsRtf(fromUser + " Says\n",
									   new Font(this.Font, FontStyle.Bold), RtfColor.Blue);
				_rtBox.AppendTextAsRtf(messageReceived, new Font(this.Font, FontStyle.Bold), RtfColor.Gray);
				if ((_index = _rtBox.Find(":)")) > -1)
				{
					_rtBox.Select(_index, ":)".Length);
					_rtBox.InsertImage(pbSmile.Image);
				}
				chatForm.rtBox.AppendRtf(_rtBox.Rtf);
				// Scroll to bottom so newly added text is seen.
				chatForm.rtBox.Select(chatForm.rtBox.TextLength, 0);
				chatForm.rtBox.ScrollToCaret();

				// Return focus to message text box
				chatForm.txtSendMessage.Focus();
			}
			));
			
		}