Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles but open to customize. This is an open version of Ignace Maes development called MaterialSkin
High quality images can be found at the bottom of this page.
1. Add the library to your project
Clone this project from GitHub, compile the library and add it as a reference. We will upload as Nuget Package when the development is more advanced
2. Add the MaterialSkin components to your ToolBox
Simply drag the MaterialSkin.dll file into your IDE's ToolBox and all the controls should be added there.
3. Inherit from MaterialForm
Open the code behind your Form you wish to skin. Make it inherit from MaterialForm rather than Form. Don't forget to put the library in your imports, so it can find the MaterialForm class!
C# (Form1.cs)
public partial class Form1 : MaterialForm
VB.NET (Form1.Designer.vb)
Partial Class Form1
Inherits MaterialSkin.Controls.MaterialForm
4. Initialize your colorscheme
Set your preferred colors & theme. Also add the form to the manager so it keeps updated if the color scheme or theme changes later on.
4.1. Use official Google's Material Design Principle colors
C# (Form1.cs)
public Form1()
{
InitializeComponent();
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);
materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
}
VB.NET (Form1.vb)
Imports MaterialSkin
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim SkinManager As MaterialSkinManager = MaterialSkinManager.Instance
SkinManager.AddFormToManage(Me)
SkinManager.Theme = MaterialSkinManager.Themes.LIGHT
SkinManager.ColorScheme = New ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE)
End Sub
End Class
4.2. Use custom color from String (non-official Google's Material Design Principle colors) If you want use a color palette that is not alloweb by Google's Material Design Principle, MaterialSkin+ supports custom colors only providing your colors Hex Codes to the wished ColorScheme parameter.
Valid Parameter Formats
Parameter | Format |
---|---|
(#)ARGB | "#0000FF00" |
(#)RGB | "#00FF00" |
(#)ShortRGB | "#00F" |
ARGB | "0000FF00" |
RGB | "00FF00" |
ShortRGB | "00F" |
Example:
C# (Form1.cs)
public Form1()
{
InitializeComponent();
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);
materialSkinManager.Theme = MaterialSkinManager.Themes.LIGHT;
materialSkinManager.ColorScheme = new ColorScheme("#00480157", "#370142", "DC2EFF", "00BB5FCF", TextShade.WHITE);
}
VB.NET (Form1.vb)
Imports MaterialSkin
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim SkinManager As MaterialSkinManager = MaterialSkinManager.Instance
SkinManager.AddFormToManage(Me)
SkinManager.Theme = MaterialSkinManager.Themes.LIGHT
SkinManager.ColorScheme = New ColorScheme("#00480157", "#370142", "DC2EFF", "00BB5FCF", TextShade.WHITE)
End Sub
End Class
4.3. Use custom color from Decimal Integer (non-official Google's Material Design Principle colors) If you want use a color palette that is not alloweb by Google's Material Design Principle, MaterialSkin+ supports custom colors only providing your colors Hex Codes to the wished ColorScheme parameter.
Valid Parameter Formats
Parameter | Format |
---|---|
ARGB | 0x0000FF00 |
RGB | 0x00FF00 |
ShortRGB | 0x00F |
Example:
C# (Form1.cs)
public Form1()
{
InitializeComponent();
var materialSkinManager = MaterialSkinManager.Instance;
materialSkinManager.AddFormToManage(this);
materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
materialSkinManager.ColorScheme = new ColorScheme(0x00C926b3, 0xA1008B, 0xDC2EFF, 0x006E70FF, TextShade.WHITE);
}
VB.NET (Form1.vb)
Imports MaterialSkin
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Dim SkinManager As MaterialSkinManager = MaterialSkinManager.Instance
SkinManager.AddFormToManage(Me)
SkinManager.Theme = MaterialSkinManager.Themes.DARK
SkinManager.ColorScheme = New ColorScheme(0x00C926b3, 0xA1008B, 0xDC2EFF, 0x006E70FF, TextShade.WHITE)
End Sub
End Class
This project is under active development.
- MaterialSkin for .NET WinForms: MaterialSkin for .NET WinForms
If you wish to contact me for anything you can get in touch at:
- Twitter: https://twitter.com/cygnus_project
A simple demo interface with MaterialSkin components.
The MaterialSkin checkboxes.
The MaterialSkin radiobuttons.
The MaterialSkin ListView.