diff --git a/FastColoredTextBox/FastColoredTextBox.cs b/FastColoredTextBox/FastColoredTextBox.cs
index 1478374f..38d4b24d 100644
--- a/FastColoredTextBox/FastColoredTextBox.cs
+++ b/FastColoredTextBox/FastColoredTextBox.cs
@@ -233,6 +233,13 @@ public char[] AutoCompleteBracketsList
[Description("AutoComplete brackets.")]
public bool AutoCompleteBrackets { get; set; }
+ ///
+ /// Force inserted string or char to be uppercase
+ ///
+ [DefaultValue(false)]
+ [Description("Force upper case.")]
+ public bool ForceUpperCase { get; set; }
+
///
/// Colors of some service visual markers
///
@@ -2729,7 +2736,7 @@ public virtual void InsertText(string text, bool jumpToCaret)
if (Selection.IsEmpty && Selection.Start.iChar > GetLineLength(Selection.Start.iLine) && VirtualSpace)
InsertVirtualSpaces();
- lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, text));
+ lines.Manager.ExecuteCommand(new InsertTextCommand(TextSource, ForceUpperCase ? text.ToUpper() : text));
if (updating <= 0 && jumpToCaret)
DoCaretVisible();
}
@@ -2988,7 +2995,7 @@ protected virtual void InsertChar(char c)
InsertVirtualSpaces();
//insert char
- lines.Manager.ExecuteCommand(new InsertCharCommand(TextSource, c));
+ lines.Manager.ExecuteCommand(new InsertCharCommand(TextSource, ForceUpperCase ? char.ToUpper(c) : c));
}
finally
{