public static void FormatRowRichText(ref RichText text, Color textColor, RowState state, string highlightText) { if (textColor != SystemColors.WindowText || highlightText != null || (state & RowState.InactiveSelected) != 0) { text = (RichText)text.Clone(); if (textColor != SystemColors.WindowText || (state & RowState.InactiveSelected) != 0) { text.SetColors(textColor, Color.Transparent); } if (highlightText != null) { text.SetColors(textColor, Color.Transparent); text.SetColors(SystemColors.HighlightText, Color.Transparent, 0, highlightText.Length); } } }