IgnaceMaes / MaterialSkin

Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles.
MIT License
2.84k stars 831 forks source link

Importing Library? #102

Closed ErraticFox closed 8 years ago

ErraticFox commented 8 years ago

I'm new to C# and VB, how do I import the library? If that means the reference, then it's not working. When I put the MaterialForm part, I get "The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: Form1 --- The base class 'System.Void' cannot be designed."

lukeskinner commented 8 years ago

The easiest way to get started is to use NuGet to import the library. Most of this can be found in the readme, but I can list of the basics with some helpful links.

First thing you want to check is that your WinForms project (the UI) is set to at least .NET Framework 4.5. You can check this link on how to do that.

If you're unsure of how to use NuGet then a helpful guide can be found here. See the Consuming a .NET NuGet Package section. You want to search for MaterialSkin in NuGet and install that to your WinForms project. This will automatically setup all the references for you.

After that you want to change your forms to inherit from MaterialForm instead of Form like this (close and reopen your designer for the form after):

C# (Form1.cs)

  public partial class Form1 : MaterialForm

VB.NET (Form1.Designer.vb)

  Partial Class Form1
    Inherits MaterialSkin.Controls.MaterialForm

At this point your form should look different with no errors.

Now you need to setup your Toolbox window to show the new MaterialSkin controls. To do this right click inside the Toolbox window --> Choose Items --> Browse --> Find the MaterialSkin dll in the packages folder inside your solutions folder (e.g. packages\MaterialSkin.x.x.x\lib) --> Click OK on the dll.

You should now see all of the MaterialSkin controls where you can drag and drop them on to the form.

tunip3 commented 5 years ago

II get a bunch of errors when trying to do that