473,569 Members | 2,984 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with RichTextbox Rtf property, is it a major bug?

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 moment I retrieve the RTF code from the database back to the
Rtf property, it ignores any tags that refer to bullet information. I don't
understand why.

This is the code that is stored in the database generated by the Richtextbox:

{\rtf1\ansi\ans icpg1252\deff0\ deflang1033{\fo nttbl{\f0\fnil\ fcharset0
Microsoft Sans Serif;}{\f1\fni l\fcharset2 Symbol;}}
{\colortbl ;\red0\green0\b lue0;}
\viewkind4\uc1\ pard\f0\fs17 T\cf1 here should be a bulleted list here\par
\pa
\pard{\pntext\f 1\'B7\tab}{\*\p n\pnlvlblt\pnf1 \pnindent0{\pnt xtb\'B7}}bullet \par
{\pntext\f1\'B7 \tab}bullet\par
{\pntext\f1\'B7 \tab}bullet\par
{\pntext\f1\'B7 \tab}bullet\par
{\pntext\f1\'B7 \tab}bullet\cf0 \par
}

The moment I try to reference it back to the Rtf property like this,

rtfstring =
"{\rtf1\ansi\an sicpg1252\deff0 \deflang1033{\f onttbl{\f0\fnil \fcharset0
Microsoft Sans Serif;}{\f1\fni l\fcharset2 Symbol;}}
{\colortbl ;\red0\green0\b lue0;}
\viewkind4\uc1\ pard\f0\fs17 T\cf1 here should be a bulleted list here\par
\pa
\pard{\pntext\f 1\'B7\tab}{\*\p n\pnlvlblt\pnf1 \pnindent0{\pnt xtb\'B7}}bullet \par
{\pntext\f1\'B7 \tab}bullet\par
{\pntext\f1\'B7 \tab}bullet\par
{\pntext\f1\'B7 \tab}bullet\par
{\pntext\f1\'B7 \tab}bullet\cf0 \par
}"

richtextbox.rtf = rtfstring

The only code that is accepted by the Rtf property is,

{\rtf1\ansi\ans icpg1252\deff0\ deflang1033{\fo nttbl{\f0\fnil\ fcharset0
Microsoft Sans Serif;}}
\viewkind4\uc1\ pard\f0\fs17\pa r
}

What I dont' understand about this is, the RTF code was generated by the
Richtextbox. How come, I can't reference it back to the same Richtextbox? In
the process of retrieval and saving, there aren't any modifications to the
value of the RTF code.

Please help me on this. If you've encountered this before or if you know
anything about the behavior of Rtf in the Richtextbox control built in .Net.

Nov 21 '05 #1
0 2133

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1933
by: Frank White | last post by:
I noticed what I thought was peculiar behavior when I used the RichTextBox. If you get the RTF string from a RichTextBox using the RichTextBox.Rtf property, the RichTextBox treats this as an action that cannot be undone. So if you would run the following code as the TextChanged event handler of a RichTextBox called "rtbox" .... private void...
2
17273
by: Hariharan S | last post by:
Hi Guys, I have a string, say "Hello World" and would like to format the way I want to (say, wanna have the Hello to be bold italic and the World to be of font size 14 or so) and put it in the RichTextBox, I created. Just want to paste or write this string to the RichTextBox; what command should I use? I used the following command and it...
10
11616
by: D Steward | last post by:
I can't seem to add a newline (/n) to get a richtextbox control to display text on successive lines. The text that I type is overwritten. How do I remedy this My example richTextBox->Multiline = true richTextBox->Text = S"First line /n" richTextBox->Text = S"Second line" Thanks
6
7104
by: andreas | last post by:
A selected text has fontstyles like bold and italic and underscore I want to remove one of them without changing the other fontstyles. How to do that? Thanks for any response
9
4849
by: James Wong | last post by:
Hi, I use the RichTextBox in my program. It will use different language in this RichTextBox (chinese and english characters), and it set the "DualFont" and use different fonts. By the way, how can I print out this content to printer easily? Thanks! James
3
7164
by: michael sorens | last post by:
The documentation for the RichTextBox is sketchy at best. I want to do a very simple task but I cannot find information on this. I am using a RichTextBox as an output window. Some text I want to just add plain (e.g.. rtf.Text += "new stuff..."; ) but some text, when added, I want to be in a different color or font size. Find() will not...
8
2229
by: Tom | last post by:
Inserting text into a RichTextBox is a snap! >> textBox1.Text += "Enter string 0000\n"; textBox1.Text += "Enter string 0001\n"; textBox1.Text += "Enter string 0002\n"; textBox1.Text += "Enter string 0003\n"; How do I then go back and programmatically remove let's say line #2? As amazingly simple as this sounds ... I am equally...
1
4911
by: Andrus | last post by:
I need to save font selected by user by Ctrl+MouseWheel in Winforms RichTextBox. I tried override below but this does not remember font: in this method Font.Size property seems to be always *initial* Font size when RichTextBox is created, *not* the font size set by ctrl+mouse wheel. How to find the font size set by Ctrl+Mouse wheel ?
1
3010
by: shakti s | last post by:
hi, My aplologies if this is really a silly question. I am trying to read contents like images and tables from one rich text box and paste it into another RTF control(i.e. another Richtextbox). when i am doing this...the rtf encoding is getting displayed in the destination RichTextBox. i think i am missing out something there.
0
7703
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3662
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
950
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.