WinForms.Markdown
1.0.1
.NET 6.0
This package targets .NET 6.0. The package is compatible with this framework or higher.
.NET Framework 4.8
This package targets .NET Framework 4.8. The package is compatible with this framework or higher.
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package WinForms.Markdown --version 1.0.1
NuGet\Install-Package WinForms.Markdown -Version 1.0.1
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="WinForms.Markdown" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WinForms.Markdown" Version="1.0.1" />
<PackageReference Include="WinForms.Markdown" />
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 WinForms.Markdown --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: WinForms.Markdown, 1.0.1"
#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 WinForms.Markdown@1.0.1
#: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=WinForms.Markdown&version=1.0.1
#tool nuget:?package=WinForms.Markdown&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
WinForms.Markdown
A native, lightweight, open-source Markdown control for Windows Forms. Markdown
is parsed into a small AST and rendered directly onto the control using GDI+
(TextRenderer) — no web browser, no WebView2, and no HTML anywhere in the
pipeline.
Target frameworks
The sample application stays on a modern TFM.
Features
- Renders Markdown natively with
System.Drawing/ GDI+. - Vertical scrolling via the built-in
AutoScrollscrollbar. ForeColor,BackColor,Font, andPaddingact as baseline styling.- Parser (AST/tokenizer) and drawing engine are cleanly separated.
Supported syntax
| Element | Markdown |
|---|---|
| Headings | # H1, ## H2, ### H3 (through ######) |
| Bold | **bold** or __bold__ |
| Italic | *italic* or _italic_ |
| Underline | <u>underline</u> or ~underline~ |
| Strikethrough | ~~strikethrough~~ |
| Hyperlinks | [text](url) and <https://example.com> |
| Paragraphs | Consecutive lines |
Usage
Install the package, then drop a MarkdownControl onto a form:
using WinForms.Markdown;
var form = new Form
{
Text = "Hello Markdown",
ClientSize = new Size(720, 480),
};
var markdown = new MarkdownControl
{
Dock = DockStyle.Fill,
MarkdownText = "# Hello\n\nThis is **bold** and *italic* text.",
};
form.Controls.Add(markdown);
Application.Run(form);
Control properties
| Property | Type | Default | Description |
|---|---|---|---|
MarkdownText |
string |
"" |
The raw Markdown to parse and render. |
ForeColor |
Color |
SystemColors.WindowText |
Default text colour. |
BackColor |
Color |
SystemColors.Window |
Control background colour. |
Font |
Font |
SystemFonts.DefaultFont |
Base font; headings and inline styles derive from this. |
Padding |
Padding |
new Padding(10, 8, 10, 8) |
Margin around the rendered document. |
LinkColor |
Color |
Color.FromArgb(0, 102, 204) |
Colour used for hyperlinks. |
AutoScroll |
bool |
true |
Enables the built-in vertical scrollbar. |
Licence
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0-windows7.0 is compatible. net7.0-windows was computed. net8.0-windows was computed. net8.0-windows7.0 is compatible. net9.0-windows was computed. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
| .NET Framework | net48 is compatible. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- No dependencies.
-
net10.0-windows7.0
- No dependencies.
-
net6.0-windows7.0
- No dependencies.
-
net8.0-windows7.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Fixed garbled rendering when scrolling.