Add a fresh look to your .NET WinForms application with controls using the Modern 'Metro' UI theme of Windows 8.
This work is based on software from the winforms-modernui project. Changes and additions include:
- Custom themes (see themes.xml)
- Conversion into a clean, aspect-oriented design (compare old ./. new).
- Complete rewrite of Theme Manager to support global and cascading style changes (see MetroStyleManager for docs)
- True transparent controls (not the 'use parent BackColor" approach - see Transparency aspect)
- Design-time support for "cleaning" some of the serialization garbage left by the original project code
- Style Extender to support theming of legacy controls
- Massively-reduced flickering throughout most control types
- Font Resolver to implement fall-back alternatives for Segoe UI fonts
- Implemented compliancy with .NET 4, Client Profile (i.e. no dependency on System.Design.dll)
- Fixed issues with maximizing and restoring windows
- CLS Compliancy and compatibility with partially-trusted callers (APTCA)
- Added true Aero Shadow and lightweight System Drop shadow, multiple bug-fixes and significant improvements to the other shadow controls
- Improvements to display over Remote Desktop (minimized flickering, dynamic switching to a more lightweight display theme)
- Form and Panel borders, optionally activated only during remote-desktop sessions as a drop shadow replacement
- True multi-monitor support
- Correct centering forms to screen or parent
- Lot's of fixes to designer serialization
- Plus loads of other bug fixes throughout the library...
Some of the changes have been back-ported by the original author but are incomplete or have been broken due to his silly renaming and refactoring policies. When he also insisted on deleting ALL documentation, I decided to fork the project.
Getting started
Once you have installed the software, add a reference to MetroFramework.dll and MetroFramework.Design.dll. The latter is for design-time support and doesn't need to be deployed, i.e. you should set the "Copy Local" property to false.
Due to the non-intrusive installation procedure, support for creating your first form isn't optimal. The recommended procedure is to add a new "Windows Form" to your project. Then press F7 to switch into code view and change the base class from "Form" to "MetroFramework.Forms.Form". Switch back to design view and you should be able to add more MetroFramework controls from the Toolbox as usual.
Installation
It is recommended to install MetroFramework using NuGet, as this will give you release builds and automatic updates. In Visual Studio, right-click on your project in Solution Explorer and choose "Manage NuGet packages...". Then "Search Online" for "MetroFramework" and install the "MetroFramework Installer". The installer will pull-in all required dependencies, i.e. there is no need to install other packages manually.
To install the packages using the NuGet shell, simply type the below:
Install-Package MetroFramework
More information about the NuGet packages: http://nuget.org/packages/MetroFramework/
If you like living on the edge, download the latest source code or clone the project on Git Hub.
Supported Platforms
Windows XP and later, incl. Windows 8
Requirements
.NET Framework 4.0 (Client Profile) and later.
Controls
- Button
- ComboBox
- Checkbox
- RadioButton
- Toggle
- Label
- SelectableLabel
- Link
- Panel
- ScrollBar
- Tile
- ProgressBar
- ProgressSpinner
- TabControl
- TrackBar
- UserControl
Components
- StyleManager (Cascading styles and theming)
- StyleExtender (Apply selected theme propertys to legacy controls)
- ToolTip
Screenshots
MetroFramework comes with two stock themes, Light and Dark. These themes are complimented by a selection of style colors to allow further customization. You can easily add your own themes (seee themes.xml).
Light
Dark
(Image source: http://github.com/viperneo/)
License
Copyright (c) 2013 Jens Thiel, http://thielj.github.io/MetroFramework/
This Software is licensed under the MIT (new) license. See LICENSE for details.