TE Edit Control .NET Core / .NET Framework Help
Product page

ReplaceLastWord

This event is fired during keyboard text entry after the user completes a word. It lets you provide a replacement word for the word just entered.

tern.ReplaceLastWord+=
   new Tern.EventReplaceLastWord(ReplaceLastWord);
protected void ReplaceLastWord(object Sender, string LastWord,
                        out bool replace, out string NewText)
  {
     // an example of replace the last word entered
     replace=true;
     NewText="";
     if (LastWord=="dog")      NewText="Golden Retriever";
     else if (LastWord=="cat") NewText="Himalayan tiger";
     else replace=false;
  } 

The 'LastWord' parameter indicates the word just completed.

The 'replace' parameter should be set to true if you are providing a replace text.

The 'NewText' parameter indicates the new text.