Vax-FCTB 2.19.0.220

dotnet add package Vax-FCTB --version 2.19.0.220
                    
NuGet\Install-Package Vax-FCTB -Version 2.19.0.220
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Vax-FCTB" Version="2.19.0.220" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Vax-FCTB" Version="2.19.0.220" />
                    
Directory.Packages.props
<PackageReference Include="Vax-FCTB" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Vax-FCTB --version 2.19.0.220
                    
#r "nuget: Vax-FCTB, 2.19.0.220"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Vax-FCTB@2.19.0.220
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Vax-FCTB&version=2.19.0.220
                    
Install as a Cake Addin
#tool nuget:?package=Vax-FCTB&version=2.19.0.220
                    
Install as a Cake Tool

FastColoredTextBox

Fast Colored TextBox is text editor component for .NET. Allows you to create custom text editor with syntax highlighting. It works well with small, medium, large and very-very large files.

It has such settings as foreground color, font style, background color which can be adjusted for arbitrarily selected text symbols. One can easily gain access to a text with the use of regular expressions. WordWrap, Find/Replace, Code folding and multilevel Undo/Redo are supported as well.

中文文档

Update Logs

29-09-2026 (V2.18.0.220)

  • TextBox migration: the public properties a WinForms form needs but FCTB lacked are now implemented, so a TextBox can be replaced by a FastColoredTextBox without touching the call site: MaxLength, CharacterCasing, CanUndo, Modified, HideSelection, PasswordChar, UseSystemPasswordChar, PlaceholderText, PreferredHeight, ScrollBars, ShortcutsEnabled, TextAlign, AutoCompleteMode, AutoCompleteSource, AutoCompleteCustomSource
  • Lines now returns string[] and has a setter, matching TextBoxBase.Lines
  • Removed the new bool RightToLeft shadow that threw NotImplementedException; the inherited Control.RightToLeft is used again
  • ForceUpperCase is now a shorthand for CharacterCasing = Upper

See Migrating from TextBox below.

07-09-2026 (V2.17.0.206)

  • Horizontal scroll text overlapping line number area fully fixed (CJK line re-evaluation, non-uniform char width support)

04-09-2025 (V2.17.0.205)

  • Undo/Redo core logic refactored (position accuracy, cross-line support)
  • Column selection mode IndexOutOfRangeException fixed
  • Horizontal scroll text overlapping line numbers fixed
  • Default padding 2px (matches WinForms TextBox)
  • Localization support for Find/Replace/GoTo/Hotkeys forms (EN/ZH)
  • Chinese labels shortened to match English width
  • Label z-order fixed (no longer overlaps controls)
  • Redo shortcut changed to Ctrl+Y (standard Windows convention)
  • .NET 10.0 support added

25-12-22 (V2.17.0.203)

  • A wordwrapping bug fixed
  • .NET6.0 target removed for better code optimization (now targeting .NET7-9)
  • Some other code optimization

25-04-02 (V2.17.0.2)

  • CJKL mix wordwrapping almost perfect/中日韩拉丁字母混合换行基本完美
  • Targeting .NET6.0-9.0
  • Restructed the code and minor optimization

24-12-30 (V2.17.0.0)

  • Reforked from Wiredwizard:-Daxanius:-PavelTorgashov 24-12-25 (V2.16.27.106)
  • Improved CJK support with demo added,now it suits general CJK application comfortably.
  • CN:添加了CJK支持,做了demo,现在支持一般CJK应用没问题。 24-12-24 (V2.16.27.103)
  • Add UseCJK property, may need further improvements.

24-12-20 (V2.16.27.100)

  • Start to support correct displaying Chinese based on the lately found fork by Daxanius, though not perfect, still needs some tweeks in later version
  • CN:在能找到的最新的Daxanius版本上增加了汉字显示支持,虽不完美还需在以后版本调整
  • Multitargeting net6.0-8.0
  • Upgrade to C#12 sematics

Migrating from TextBox

Every public instance property of System.Windows.Forms.TextBox exists on FastColoredTextBox with the same type and the same public accessors, so dropping one control in place of the other compiles. The members that had to be added, and how far they go:

Member Behaviour
MaxLength Limits typing, like TextBoxBase. Assigning Text/SelectedText is not truncated (same as TextBox). Negative values throw.
CharacterCasing Applied to every char that enters the control, typed or inserted. ForceUpperCase is a shorthand for CharacterCasing = Upper.
CanUndo true while there is something to undo.
Modified Mirrors IsChanged; settable.
HideSelection Hides the selection while the control is unfocused (default true).
PasswordChar / UseSystemPasswordChar Masks the rendered glyphs. The text itself, the clipboard and the exporters are untouched.
PlaceholderText Drawn while the control is empty.
PreferredHeight Height of one text line.
ScrollBars None/Both map onto ShowScrollBars. Vertical/Horizontal behave as Both: the scrollbars are driven by ScrollableControl.AutoScroll and cannot be shown one axis at a time.
ShortcutsEnabled false suppresses the hotkeys of HotkeysMapping; typing is unaffected.
TextAlign Offsets a single-line control's text. Ignored while Multiline or WordWrap is set.
AutoCompleteMode / AutoCompleteSource / AutoCompleteCustomSource Append and SuggestAppend append the missing tail when a delimiter is typed (SuggestAppend leaves it selected). Single-line only, like TextBox. The inline ghost hint of Suggest is not drawn - use AutocompleteMenu for that.

Still not carried over (used far less often, add them if you need them): DeselectAll, Paste(string), GetCharFromPosition, GetCharIndexFromPosition, GetPositionFromCharIndex, GetLineFromCharIndex, GetFirstCharIndexFromLine, GetFirstCharIndexOfCurrentLine, and the *Changed events for ReadOnly, Multiline, AcceptsTab, BorderStyle, HideSelection, Modified and TextAlign.

Two signatures deliberately differ from TextBox because FCTB's own API depends on them: TextChanged carries TextChangedEventArgs rather than EventArgs, and right-to-left text is not rendered (RightToLeft is accepted but ignored).

Known Issues

  • Wordwrapped lines may exceed controlwidth in some cases, but can be solved by setting PaddingRight property.

image

More details http://www.codeproject.com/Articles/161871/Fast-Colored-TextBox-for-syntax-highlighting

Nuget package https://www.nuget.org/packages/VAX-FCTB/

Product Compatible and additional computed target framework versions.
.NET net7.0-windows7.0 is compatible.  net8.0-windows was computed.  net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net9.0-windows7.0 is compatible.  net10.0-windows was computed.  net10.0-windows7.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0-windows7.0

    • No dependencies.
  • net7.0-windows7.0

    • No dependencies.
  • net8.0-windows7.0

    • No dependencies.
  • net9.0-windows7.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Vax-FCTB:

Package Downloads
Wima.WinForm

Wima通用Winform可复用控件和窗体库

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.19.0.220 93 10/8/2026
2.18.0.220 129 9/29/2026
2.17.0.216 101 9/25/2026
2.17.0.208 106 9/19/2026
2.17.0.207 101 9/19/2026
2.17.0.206 150 9/7/2026
2.17.0.205 125 9/4/2026
2.17.0.204 227 7/23/2026
2.17.0.203 437 12/22/2025
2.17.0.201 588 4/2/2025
2.17.0.101 340 12/31/2024
2.16.27.106 245 12/25/2024
2.16.27.104 223 12/25/2024
2.16.27.103 219 12/24/2024
2.16.27.101 237 12/23/2024
2.16.27.100 262 12/23/2024

- 2026/9/29 Text setter no longer leaves a full-selection residue: it did SelectAll -> InsertText -> GoHome, but GoHome only moves the selection Start to (0,0) and keeps End, so every programmatic Text = ... left the whole text selected and the first click into the box "selected everything". The selection is now collapsed to the caret (Selection.End = Selection.Start, then DoCaretVisible) inside the same BeginUpdate block
     - 2026/9/29 Markdown highlighter rewritten around a fenced-code-block state machine: a fence is now a protected region, so "# heading", "- list", "**bold**" and "[link](x)" inside a code block are no longer highlighted as markdown
     - 2026/9/29 Fenced code blocks are highlighted with the language named in the info string (```csharp, ```js, ```sql, ... via the built-in modes), with a guard against a ```markdown fence recursing
     - 2026/9/29 New markdown syntax: __strong__, _emphasis_, autolinks (<https://host>), task list checkboxes (- [x]), ordered lists with ")", thematic breaks with spaces (- - -), backslash-escaped markers; "#" only starts a heading when followed by a space
     - 2026/9/29 Heading style covers the text only: the leading #'s and the optional closing #'s are left unstyled, and the levels are told apart by shade (a scaled font would break the caret/selection/word-wrap geometry of the fixed-width grid)
     - 2026/9/29 Markdown backgrounds and bars are derived from BackColor instead of hardcoded light colours, and are rebuilt when BackColor changes, so a dark theme works; the left bar of a code block follows the text position instead of being glued 2px from the control edge
     - 2026/9/29 Markdown styles are ordered so the control renders them correctly: the block tint is a plain Style (not a TextStyle), so bold/italic/code nested in a quote or a code block are no longer swallowed by the container
     - 2026/9/29 AutoIndentNeeded handles markdown: the line after a list item is indented (AutoIndentEventArgs can only add whitespace, so the "- " marker is not copied); blockquotes are not indented
     - 2026/9/29 Markdown no longer widens the highlight range to the visible range on every keystroke; set HighlightingRangeType = VisibleRange (as the samples do) if you want the whole viewport re-highlighted
     - 2026/9/29 Rebuilding the markdown styles now clears the text first: ClearStyle removes by style identity, so with the highlighter already pointing at new style objects the old ones stayed on the chars and DrawString threw ArgumentException on a freed brush
     - 2026/9/29 StyledChar.AddStyle no longer bumps LastStyleIndex when the style is already on the char, which left a null in Styles and silently hid every style added to that char afterwards
     - 2026/9/29 GetStylesOfChar no longer throws NullReferenceException for a char that carries no style
     - 2026/9/29 Breaking: MarkdownCodeBlockStyle and MarkdownHeadingStyle are replaced by MarkdownBlockStyle (background + left bar, draws no text); MdCodeInlineStyle is renamed MdInlineCodeStyle, and MdAutoLinkStyle, MdUnderscoreItalicStyle and MdTaskListDoneStyle are new
     - 2026/9/29 TextBox migration: the 15 public properties a WinForms form needs but FCTB lacked are implemented, so a TextBox can be swapped for a FastColoredTextBox without touching the call site: MaxLength, CharacterCasing, CanUndo, Modified, HideSelection, PasswordChar, UseSystemPasswordChar, PlaceholderText, PreferredHeight, ScrollBars, ShortcutsEnabled, TextAlign, AutoCompleteMode, AutoCompleteSource, AutoCompleteCustomSource
     - 2026/9/29 Lines now returns string[] (was IList<string>) and has a setter, matching TextBoxBase.Lines
     - 2026/9/29 Removed the `new bool RightToLeft` shadow that threw NotImplementedException: the inherited Control.RightToLeft (System.Windows.Forms.RightToLeft) is used again
     - 2026/9/29 ForceUpperCase is now a shorthand for CharacterCasing = Upper (it was previously only applied on insert, and is now honoured for Lower/Normal too)      - 2026/9/25 New AllowProportionalFont property (default false): SetFont no longer rejects non-monospace fonts when enabled (rendering/caret/wrap already use per-char widths; tab/column-selection/hscroll remain approximate)
     - 2026/9/25 New TextRenderingHint property (default SystemDefault) applied in OnPaint: lets hosts force ClearType/AntiAlias to remove small-size text aliasing (SystemDefault can degrade on the double-buffered surface)
     - 2026/9/25 CharSizeCache.GetCharSize is now thread-safe (lock): the non-concurrent Dictionary could be corrupted by concurrent font measurement (e.g. parallel tests)
     - 2026/9/25 TextStyle classic (non-IME) rendering advanced x by `dx` which was never set (always 0), stacking every char of a style run on the same x; a folded line (drawn as one FoldedBlockStyle run) collapsed its text at the line start. Now advances by GetCharWidth per char
     - 2026/9/25 Folded block marker now uses per-char widths (CJK/mixed text): FoldedBlockStyle drew the box with a fixed CharWidth, so with UseCJK the collapsed line's text fell outside the box (box shifted right)
     - 2026/9/25 Word wrap now recalculated when the client width changes (OnSizeChanged): resizing the control (scrollbar toggling, layout pass, folding-induced row height changes) previously left stale wrap cut-offs and lines could overlap
     - 2026/9/19 Undo/Redo fixes: undo history now keeps the most recent edits when the 200-entry limit is exceeded (previously kept the oldest), RemoveLines undo restores removed content even when the document becomes empty, single-line document is preserved after RemoveLines
     - 2026/9/19 Markdown highlighter fixes: fenced code blocks now match across lines (missing Singleline), headings no longer swallow the next line, inline code no longer spans lines, images no longer double-styled as links, italic no longer fires on math asterisks (2 * 3 * 4)
     - 2026/9/19 Assembly version now matches the NuGet package (was 0.0.0.0); xunit regression test suite added (FastColoredTextBox.Tests)
     - 2026/9/19 Reliability: GDI brush leaks on language switch fixed, Ruler disposes event subscriptions, SaveToFile safe for empty documents and on write failure, EncodingDetector uses ReadExactly and no longer returns obsolete UTF-7, iterative Undo/Redo (no stack overflow on long autoUndo chains), Text/Length newline consistency, compiled regex caching for highlighting and auto-indent
     - 2026/9/11 Added native Markdown syntax highlighting (Language.Markdown) with bold+color heading levels, inline code, fenced code blocks with border, blockquotes, strikethrough, links, images, lists, and HR
     - 2026/9/7 Horizontal scrolling right: text no longer slides over the line number area; CJK lines now position the first visible char by actual char widths (no left gap)
     - 2026/9/3 Undo/Redo core logic refactored (position accuracy, cross-line support)
     - Column selection mode IndexOutOfRangeException fixed
     - Default padding (2px) matches WinForms TextBox
     - Localization support for Find/Replace/GoTo/Hotkeys forms (EN/ZH)
     - Chinese labels shortened to match English width
     - Label z-order fixed (no longer overlaps controls)
     - Redo shortcut changed to Ctrl+Y (standard Windows convention)
     - .NET 10.0 support added
     - 2026/7/23 "Select all" problem when evaluating text property/修正设置Text属性全选问题
     - 2025/12/22 Wordwrap bug fix/修复换行错误
     - CJKL mix wordwrapping almost perfect/中日韩拉丁字母混合换行基本完美
     - Targeting NET7.0-10.0
     - Restructed the code and minor optimization