List of Exercises

Dark Light Themes in WinForms c#

	    
using MaterialSkin;
using MaterialSkin.Controls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Dark_Light_Theme
{
// C# Webclient Download a File from Internet by URL
  public partial class Form1 : MaterialForm
  {
    public Form1()
    {
      InitializeComponent();
      materialCheckedListBox1.Items.Add("test1");
      materialCheckedListBox1.Items.Add("test2");
      materialCheckedListBox1.Items.Add("test3");
      var materialSkinManager = MaterialSkinManager.Instance;
      materialSkinManager.AddFormToManage(this);
      materialSkinManager.Theme = MaterialSkinManager.Themes.DARK;
      materialSkinManager.ColorScheme = new ColorScheme(Primary.BlueGrey800, Primary.BlueGrey900, Primary.BlueGrey500, Accent.LightBlue200, TextShade.WHITE);
    }

    MaterialSkinManager TManager = MaterialSkinManager.Instance;

    private void materialSwitch1_CheckedChanged(object sender, EventArgs e)
    {
      if (materialSwitch1.Checked)
        TManager.Theme = MaterialSkinManager.Themes.LIGHT;
      else
        TManager.Theme = MaterialSkinManager.Themes.DARK;
    }

    private void materialRadioButton1_CheckedChanged(object sender, EventArgs e)
    {
      if (materialRadioButton1.Checked)
        TManager.ColorScheme = new ColorScheme(Primary.Orange800, Primary.Orange900, Primary.Orange500, Accent.Orange200, TextShade.WHITE);
    }

    private void materialRadioButton2_CheckedChanged(object sender, EventArgs e)
    {
      if (materialRadioButton2.Checked)
        TManager.ColorScheme = new ColorScheme(Primary.Green800, Primary.Green900, Primary.Green500, Accent.Green200, TextShade.WHITE);
    }

    private void materialRadioButton3_CheckedChanged(object sender, EventArgs e)
    {
      if (materialRadioButton3.Checked)
        TManager.ColorScheme = new ColorScheme(Primary.Blue800, Primary.Blue900, Primary.Blue500, Accent.Blue200, TextShade.WHITE);
    }

    private void materialButton1_Click(object sender, EventArgs e)
    {
      materialProgressBar1.Value = 0;
      materialProgressBar1.Minimum = 0;
      materialProgressBar1.Maximum = 100;
      materialCheckedListBox1.ForeColor = Color.OrangeRed;

      for (int i = 0; i < 100; i++)
      {
        materialProgressBar1.Value = i;
        System.Threading.Thread.Sleep(50);
      }
    }
  }
}
		
	 


Download the project of Visual Studio 2013 in DropBox Download


C# Dark Light Themes with MaterialSkin in WinForms


Video Thumbnail