hello, i i have a button which loads the first paragraph of my sample example when the focus is in tabpage1,loads the second paragraph when the focus is in second paragraph and so is the case for third case too.
this data comes from the datagrid view.now when i make some changes to the datagrid view of tab page2 and again load it using button click in the rich text box, i need to deletee the old contents of tab page 2 and replace it with the new contents.
basically can u tell me the code to replace some strings in the rich text box i.e clearing and inserting

sample data

The Māori in New Zealand played a game called Ki-o-rahi consisting of teams of seven players play on a circular field divided into zones, and score points by touching the 'pou' (boundary markers) and hitting a central 'tupu' or target.

Games played in Mesoamerica with rubber balls by indigenous peoples are also well-documented as existing since before this time, but these had more similarities to basketball or volleyball, and since their influence on modern football games is minimal, most do not class them as football. Northeastern American Indians, especially the Iroquois Confederation, played a game which made use of net racquets to throw and catch a small ball; however, although a ball-goal foot game, lacrosse (as its modern descendant is called) is likewise not usually classed as a form of "football."

These games and others may well go far back into antiquity. However, the main sources of modern football codes appear to lie in western Europe, especially England.

5 Years
Discussion Span
Last Post by abelLazm

basically can u tell me the code to replace some strings in the rich text box i.e clearing and inserting



// Adding /n is to generate a new Line so Output will be


Edited by finito: n/a


The code to delete contents from richtextbox is

richTextBoxEditor.SelectionStart = index;//the start of the string to be deleted
richTextBoxEditor.SelectionLength = 5;//will select string of length 5
richTextBoxEditor.SelectedText =  ""; //will replace the string with a null

This code is to insert string in any specific location in a richtextbox

richTextBoxEditor.SelectionStart = index;//where you want to add
richTextBoxEditor.SelectionLength = 1;// this will select the character at the index where you want to insert new string try to replace any space 
richTextBoxEditor.SelectedText =  " String To insert";

check this link and this link for more help

Edited by abelLazm: n/a

Votes + Comments
Hey that's cool. I didn't know that was even possible
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.