I have a textbox and if I type "Dog", My application is supposed to replace "Dog" with "Cute Dog". But when I try and run it, lots of text is generated because it is finds "Dog" in "cute dog" that it has just replaced. Here is the code:
txtMain.Text = Microsoft.VisualBasic.Strings.Replace(txtMain.Text, "Dog", "Cute Dog", 1, -1, Constants.vbTextCompare)
txtMain.Select(txtMain.Text.Length, 0)
this is being triggered on the text changed event.