/// <summary> /// Set style for range /// </summary> public void SetStyle(Style style) { //search code for style int code = tb.GetOrSetStyleLayerIndex(style); //set code to chars SetStyle(ToStyleIndex(code)); // tb.Invalidate(); }