473,395 Members | 1,341 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.

[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 10572
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.Replace("hello", "bye");

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

"Michael J Robinson" <MJ********@ananzi.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
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...
2
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...
8
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? à è ì ò ù À È Ì Ò Ù á é í ó ú ý Á É Í Ó Ú Ý â ê î ô û Â Ê Î Ô...
1
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...
0
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...
1
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...
1
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...
0
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 =...
3
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...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.