473,623 Members | 2,433 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[Richtextbox].Rtf.Replace();

Load richtextbox with a .rtf document. Want to use the
Rtf.Replace method to replace text, but nothing happens.
If anyone has suggestions it'll be greatly appreciated
Thanks - Michael

Nov 13 '05 #1
1 10581
Michael,

The reason this doesn't work is that the Replace method on the string
class will return a string where the Replace occurs. It does not modify the
original string. So, in order to perform the replace, you would have to do
this:

// Assume the textbox is named mobjRtf.
mobjRtf.Rtf = mobjRtf.Rtf.Rep lace("hello", "bye");

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- ni************* *@exisconsultin g.com

"Michael J Robinson" <MJ********@ana nzi.co.za> wrote in message
news:08******** *************** *****@phx.gbl.. .
Load richtextbox with a .rtf document. Want to use the
Rtf.Replace method to replace text, but nothing happens.
If anyone has suggestions it'll be greatly appreciated
Thanks - Michael

Nov 13 '05 #2

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

Similar topics

0
1470
by: Bertrand P. | last post by:
I want use a RichTextBox to allow users to edit and modify complex report. I need to insert at runtime many optional fields wich comes from a database. I have think "well I will use the rtf command \field !" but this command does work correctly. If you load one file wich contains \field commands like described in rtf syntax, the RichTextBox delete theses commands and replace it whith the default values
2
3991
by: Martin Dew | last post by:
I have a RichTextBox called rtbOutput. I am adding lines of text using the AppendText method. What I want to do is immediately after adding this line of text make sure that this line of text is displayed, effictively scrolling to the last line of the text box all the time. Can anyone help as I cannot seem to find a way to do this. Thanks
8
8509
by: Paul | last post by:
Hi, My VB is very rusty I'm afraid! What would be the most efficient way to remove the following ASCII characters from a string? à è ì ò ù À È Ì Ò Ù á é í ó ú ý Á É Í Ó Ú Ý â ê î ô û Â Ê Î Ô Û ã ñ õ Ã Ñ Õ ä ë ï ö ü ÿ Ä Ë Ï Ö Ü Y o O æ Æ
1
2689
by: Terry Olsen | last post by:
I'm trying to change the color table of a RichTextBox. When the app starts, it has the following RTF: {\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 A2like;}} {\colortbl ;\red255\green255\blue0;} \viewkind4\uc1\pard\fi-375\li375\cf1\f0\fs24\par } Calling the following code to alter the color table from Form1.Load:
0
3433
by: shivaranjaniadimulam21 | last post by:
Hello, I need to implement an email editor control in my application. The control should allow me to type in text in any format,font etc. This i have managed using the richtextbox control available with .NET. As the email textbox can include the embedded images I want to provide this functionality in it. Now the next stuff is I want to prepare an html file from this all the
1
1417
by: plonk | last post by:
Hi I'm having a small problem with a vb.net application (Visual Studio 2005) I'm trying to insert the contents of a Richtextbox.text into the body of an email. It all works fine, except when I open the email, all the carriage returns and linefeeds are stripped out and all the text appears on one line.
1
1700
by: bmerlover | last post by:
I'm having trouble reading quotations inside the richTextBox when a file is opened on to it. I've tried a couple different methods, most of them didn't compile. I came across one that does compile and supposedly it's suppose to work but it doesn't in my case. I tried this code to see if it would recognize the quotations. For testing purpose I wanted to see if it would start the string from the quotation. str =...
0
2874
by: bettiahamit | last post by:
here i created sequence no. with every paragraph line .. like... <p local_id = P-100>aaaaaaaaaaaaaaaaaaaaaaaaa<\p> <p local_id = P-101>bbbbbbbbbbbbbbbbbbbbbbbbb<\p> <p local_id = P-102>vvvvvvvvvvvvvvvv<\p>
3
4098
by: booyeeka | last post by:
on a windows form, i have RichTextBox, with some text, in several lines. and one button on a form. i wolud like when i click on that button, to join all richtextbox of lines in one line, but not to loose text style (like font family, color, etc.) i can not do it with Replace, like \r\n, and not with the Replace(Environment.NewLine, "")........ :-(( i have also tryed to replace \par and \pard, but still no luck....... please help!!!
0
8227
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8469
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7150
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6106
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5561
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4074
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4164
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2602
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
2
1473
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.