programatically highlight words using c#:
programatically highlight words using c#: Your output like this.... xaml: create a text block with name of tb. < TextBlock Height =" auto " TextWrapping =" Wrap " Width =" 200 " HorizontalAlignment =" Left " Margin ="45,12,0,0" Name =" tb " Text =" Textblock " VerticalAlignment =" Top " /> c# code: string source = " This is a example of Highlight a word using c# "; //Your source string [] highlight_words = { " example ", " word " }; //Your Key word On your button click event call this function like this private void button1_Click( object sender, RoutedEventArgs e) { highilight(source); } And copy paster this Function: public void highilight( string source) { int min = 0, chk = 0, chk2 = 0, tmp = 0; string negw