The WinForms Syntax Editor control is a powerful text editor control similar to the Microsoft Visual Studio editor. It provides a built-in syntax highlighting and code editing experience for popular languages. It offers all the essential features end users expect like syntax highlighting, editing, undo, redo, cut, copy, paste, IntelliSense, error validation, line numbering, highlighting modified lines, custom language configuration. It supports context choice, context tooltip, single line mode, multi-tasking with split view, word wrap, printing, and export options.
This control provides syntax highlighting for programming, scripting, and markup languages. It also allows users to customize built-in languages.
The WinForms Syntax Editor control offers built-in syntax highlighting and code editing experiences for the following languages:
Create custom syntax highlighting of keywords and operators of your own language.
IntelliSense displays a pop-up with a list of code completion options to speed up coding by reducing typos and other common mistakes.
Display helpful pop-up hints about alternate syntax for invoking what is being typed and its parameters. Choose your invocation overload with the Up and Down arrow keys or by clicking the arrow buttons in the pop-up.
Built-in interactive tooltips appear automatically when the pointer is placed over a collapsed block of text.
Display code blocks in a tree structure and expand and collapse the code blocks interactively for readability. WinForms Syntax Editor automatically chooses where to create outlines for built-in languages.
Comment or uncomment code with the help of the comment option. Users can select the required block of code to comment. WinForms Syntax Editor comments the current line when there is no selection.
Track the changed lines by displaying markers at the beginning of modified lines, after the file is loaded, or after the last file save operation.
Included is keyboard and context menu support for undo and redo operations.
Use the keyboard or context menu for clipboard operations such as cut, copy, and paste.
WinForms Syntax Editor supports rectangular block selection to select lines from specific columns, like in Visual Studio and also normal selection.
Indentation support helps format source code to improve readability.
A list of choices helps complete the word a user is typing.
Predefined typing errors are auto corrected when users press certain keys. Users can also change their autoreplace trigger key.
Display the line number at the start of a line to identify the current number and to show or hide the line number.
Use different word wrapping styles, such as wrap by word or wrap by character, based on the available text area.
Find occurrences of a specified text with constraints such as match case, match whole words, and search directions. Also search text in a specific scope like current document or within the selected content.
Replace the specified text with the replacement text as per the conditions specified. Replace the first occurrence or all occurrences of the searched text.
Built-in context menu support for file editing and selection operations, and much more.
Clearly distinguish content sections with line dividers similar to Visual Basic to improve code readability.
Highlight a particular line with a different background color. This helps users differentiate a specific line from the non-highlighted lines.
Format text by underlining it with different styles such as solid, dash, wave, and dot lines.
Users can locate a section or a line of a document for quick access in WinForms Syntax Editor, which can also be later retrieved and reviewed.
Navigate to the next character, word, or start or end of a line using the keyboard. Users can jump to specific lines using go-to-line dialog.
Display information about the current state of the control such as the current file name, line number, and column number.
Shortcut keys can be used for all editing and navigation operations. A built-in window is available for modifying the key mapping of shortcut operations.
Display a single document in several views with horizontal and vertical orientations, allowing users to work on different areas of a document at the same time.
Make the Syntax Editor a simple text box with syntax highlighting, editing, and clipboard operations.
Customize the appearance of the text color in a specific range of lines.
Display a thin vertical strip that enables users to select the content of an entire line.
Change the background color of selected text in the control.
Users can customize the background color of the control and also use gradient effects.
Users can customize the end-of-line characters and choose to show or hide them.
Use a rich set of built-in themes inspired by popular interfaces such as Visual Studio, Microsoft Office, and Expression Blend.
The WinForms Syntax Editor supports localization to display control text and messages in a specific language.
Right-to-left (RTL) direction is available for users working with languages like Hebrew, Arabic, or Persian.
Export syntax editor content with associated syntax highlighting information to XML, HTML, and RTF file formats.
Print the syntax editor content programmatically or by using the print option from the print preview. The print preview window allows users to choose an entire document or just the current page and specify the number of copies to be printed.
Use the WinForms Syntax Editor as a viewer control to view files and restrict code editing.
Easily get started with the WinForms Syntax Editor control using a few simple lines of C# code example as demonstrated below. Also explore our WinForms Syntax Editor Example that shows you how to render and configure the WinForms Syntax Editor.
pusing Syncfusion.Windows.Forms.Edit;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
EditControl editControl = new EditControl();
editControl.Dock = DockStyle.Fill;
this.Controls.Add(editControl);
}
}
The Syncfusion WinForms Syntax Editor has the following features:
You can find our WinForms Syntax Editor demo on GitHub location.
No, this is a commercial product and requires a paid license. However, a free community license is also available for companies and individuals whose organizations have less than $1 million USD in annual gross revenue, 5 or fewer developers, and 10 or fewer total employees.
A good place to start would be our comprehensive getting started documentation.
Greatness—it’s one thing to say you have it, but it means more when others recognize it. Syncfusion is proud to hold the following industry awards.