public static string ReplaceFormattingTags(string strNotes) { // This code copied from KeePass.Forms.MainForm.ShowEntryDetails (MainForm_Functions.cs). It is not otherwise exposed. KeyValuePair <string, string> kvpBold = RichTextBuilder.GetStyleIdCodes( FontStyle.Bold); KeyValuePair <string, string> kvpItalic = RichTextBuilder.GetStyleIdCodes( FontStyle.Italic); KeyValuePair <string, string> kvpUnderline = RichTextBuilder.GetStyleIdCodes( FontStyle.Underline); strNotes = strNotes.Replace(@"<b>", kvpBold.Key); strNotes = strNotes.Replace(@"</b>", kvpBold.Value); strNotes = strNotes.Replace(@"<i>", kvpItalic.Key); strNotes = strNotes.Replace(@"</i>", kvpItalic.Value); strNotes = strNotes.Replace(@"<u>", kvpUnderline.Key); strNotes = strNotes.Replace(@"</u>", kvpUnderline.Value); return(strNotes); }