Repository navigation
CodeEditorLib 1.0
CodeEditorLib v1.0.0
First public release.
I've been using this internally for a while and it's stable enough to put out. It does what it says - gives you a proper code editor control inside a WinForms app without having to wire up anything from scratch.
What's in this release
13 built-in languages
C#, C++, Java, JavaScript, Python, PHP, Go, Rust, Visual Basic, HTML, CSS, SQL, XML. Language auto-detection by file extension works too, so if the user opens a .py file you don't have to set it manually.
Light and Dark themes
Both included. Switching is one line. Making your own theme is just subclassing EditorTheme and filling in the colors.
Undo/Redo
Stack-based, goes back up to 500 actions. CanUndo and CanRedo properties make it easy to keep toolbar buttons in sync.
Auto-indent and auto-brackets
Auto-indent kicks in on Enter and matches the indentation of the previous line. Auto-brackets closes (, {, and [ automatically. Both can be turned off if they get in the way.
Find & Replace
Built-in dialog, or you can call FindNext() and ReplaceAll() programmatically. Supports case-sensitive and whole-word matching.
Line numbers Rendered in a separate panel on the left, scrolls in sync with the editor content. Width adjusts automatically as line count grows.
Code formatting
IndentSelection(), OutdentSelection(), ToggleComment() — all work on the current selection or the current line if nothing is selected.
Events
CaretPositionChanged, CodeTextChanged, LanguageChanged, FindReplaceCompleted — enough to build a proper status bar and track dirty state.
Getting started
Download CodeEditorLib.dll below and add it as a reference. That's the only file you need at runtime. No NuGet, no extra dependencies — just System.Windows.Forms and System.Drawing which you already have.
var editor = new CodeEditorControl { Dock = DockStyle.Fill };
editor.LanguageName = "CSharp";
editor.Theme = new DarkTheme();
Controls.Add(editor);
Full usage and examples are in the README.
Requirements
- Windows
- .NET Framework 2.0 or higher
Downloads
| File | Description |
|---|---|
| CodeEditorLib_1.0.zip | The compiled library, ready to reference |
| CE++_Setup_v1.0.exe | The compiled GUI, ready to use |
| Source Code.zip | Full source code |
Known issues
Nothing critical. A few things I know about and plan to fix in the next release:
- Syntax highlighting on very large files (10k+ lines) has a slight delay — the highlight timer is set to 300ms which helps, but it's not instant
- No built-in TypeScript support yet (it's on the list)
- The Find dialog doesn't support regex patterns, only plain text and whole-word matching
If something's broken or behaving unexpectedly, open an issue with a small repro case and I'll take a look.
# CodeEditorLib v1.0.0First public release.
I've been using this internally for a while and it's stable enough to put out. It does what it says — gives you a proper code editor control inside a WinForms app without having to wire up anything from scratch.
What's in this release
13 built-in languages
C#, C++, Java, JavaScript, Python, PHP, Go, Rust, Visual Basic, HTML, CSS, SQL, XML. Language auto-detection by file extension works too, so if the user opens a .py file you don't have to set it manually.
Light and Dark themes
Both included. Switching is one line. Making your own theme is just subclassing EditorTheme and filling in the colors.
Undo/Redo
Stack-based, goes back up to 500 actions. CanUndo and CanRedo properties make it easy to keep toolbar buttons in sync.
Auto-indent and auto-brackets
Auto-indent kicks in on Enter and matches the indentation of the previous line. Auto-brackets closes (, {, and [ automatically. Both can be turned off if they get in the way.
Find & Replace
Built-in dialog, or you can call FindNext() and ReplaceAll() programmatically. Supports case-sensitive and whole-word matching.
Line numbers
Rendered in a separate panel on the left, scrolls in sync with the editor content. Width adjusts automatically as line count grows.
Code formatting
IndentSelection(), OutdentSelection(), ToggleComment() — all work on the current selection or the current line if nothing is selected.
Events
CaretPositionChanged, CodeTextChanged, LanguageChanged, FindReplaceCompleted — enough to build a proper status bar and track dirty state.
Getting started
Download CodeEditorLib.dll below and add it as a reference. That's the only file you need at runtime. No NuGet, no extra dependencies — just System.Windows.Forms and System.Drawing which you already have.
var editor = new CodeEditorControl { Dock = DockStyle.Fill };
editor.LanguageName = "CSharp";
editor.Theme = new DarkTheme();
Controls.Add(editor);Full usage and examples are in the [README](README.md).
Requirements
- Windows
- .NET Framework 2.0 or higher
Downloads
| File | Description |
|---|---|
| CodeEditorLib_1.0.zip | The compiled library, ready to reference |
| CE++_Setup_v1.0.exe | The compiled GUI, ready to use |
| Source Code.zip | Full source code |
Known issues
Nothing critical. A few things I know about and plan to fix in the next release:
- Syntax highlighting on very large files (10k+ lines) has a slight delay — the highlight timer is set to 300ms which helps, but it's not instant
- No built-in TypeScript support yet (it's on the list)
- The Find dialog doesn't support regex patterns, only plain text and whole-word matching
If something's broken or behaving unexpectedly, open an issue with a small repro case and I'll take a look.