By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,673 Members | 1,268 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,673 IT Pros & Developers. It's quick & easy.

[Richtextbox].Rtf.Replace();

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.