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.

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

//Clearing
richTextBox1.Clear();


//Inserting 
richTextBox1.Text="ABCD\nEFGH";

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

Peace.

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

commented: Hey that's cool. I didn't know that was even possible +9
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.