Wednesday, September 18, 2013

How to replace all occurrences of a string with a specified string from rich text box in c#?

Sir i have successfully achieved that but the problem isn't the one you might be thinking as the problem is that i now want somehow to populate the rich text box placed in form1 with the result coming from the form2 but i don't want my form2 to get disposed or wiped-out rather i want the rich text box to have the result as i click button being in form2. Currently i am doing like this but nothing is happening:





private void button5_Click(object sender, EventArgs e)
{

String selectedWord = this.suggest_list.SelectedItem.ToString();
String word123 = this.NIDict_list.SelectedItem.ToString();
String abc = Regex.Replace(this.TextContent, word123, selectedWord);
this.FirstForm = new spellChecker_frm(abc);
}




public spellChecker_frm()
{
InitializeComponent();
i = 0 ;
}
public spellChecker_frm(String content)
{
InitializeComponent();
this.textContainer_rtb.Text = content;
}



Please help!


No comments:

Post a Comment