473,395 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

C# - Unable to set Rtf property of RichTextBox control

1
Hi All,

I am unable to set Rtf property of a RichTextBox control. The code looks like this -

Expand|Select|Wrap|Line Numbers
  1. string rtfText = richTextBoxControl.Rtf;
  2.  
  3. int RTFLoc = rtfText.IndexOf("\\rtf");
  4. int InsertLoc = rtfText.IndexOf('}', RTFLoc) - 1;
  5.  
  6. rtfText = rtfText.Insert(InsertLoc, @"{\colortbl ;\red255\green0\blue0;" + @"\red0\green255\blue0;" + @"\red0\green0\blue255;}");
  7. richTextBoxControl.Rtf = rtfText;
  8.  
Please assume these things -
1. I am trying to insert color table in RTF header. It doesn't exist before.
2. All search locations are not -1. They are valid locations.

The problem is that even after
Expand|Select|Wrap|Line Numbers
  1. richTextBoxControl.Rtf = rtfText;
the richTextBoxControl.Rtf doesn't change :(

Anybody knows this bug/feature? :)
Oct 26 '06 #1
0 1843

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: vanvee | last post by:
Hi I have a user control that contains a RichTextBox in vb.net. In my program, I create multiple instances of this control (with the RichTextBox being in each one), that appear one above the...
2
by: oneworld | last post by:
I have an application that simply reads the text in a RichTextBox control, and stores the text into the database. I want to use the plain RichTextBox control and not a database rtf control. When...
0
by: Chris Beach | last post by:
Hi there, I am using an Infragistics UltraWinTabControl control and require the focus to be switched to the first control on the selected tab page. I have used the following code, but the...
2
by: Thomas Solh?j | last post by:
Hi all. I cant databind rtf values to the rtf property of a winform richtextbox control. Does something have a clue how this i done? Ive tried this without luck:...
1
by: Nathan Carroll | last post by:
In an mdi environment I constructed a child for with a richtextbox control that is used to load .rtf's. This works fine on the intiatial load of the form but when for is closed and reopened later...
1
by: A Traveler | last post by:
Hello, i am having this problem. The exact error message is: "Unable to generate code for a value of type 'System.Web.UI.Page'. This error occurred while trying to generate the property value for...
1
by: tulasi | last post by:
I am placing textbox controls and combo box controls on richtext box and 2 command buttons on form control. after executing the application i'll place some text into textbox controls and select a...
0
by: James Manila Dot Net | last post by:
I've been having a major problem using the Rtf property of the Richtextbox. I use the RTB to generate RTF code to save it in an access database. I'm successfully able to do this. However, the...
2
by: Pascal | last post by:
hello Can one moves the contents of a richtextbox with the mouse? I do not want to put the visible "elevator"(scroller) with the property scroll: both of my richtextbox but I want to scroll...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.