Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I add the Metro UI controls to the toolbox in visual studio?

Metro controls: https://github.com/viperneo/winforms-modernui

I am trying to use the metro controls and I am going off of what I can from the sample project. What I cant seem to figure out is how to add the controls to my toolbox for easy drag and drop.

I right click my toolbox, select "choose toolbox items" and then I browse for the MetroFramework.dll and it adds all the controls, however when I try to use a control I get "Failed to create MetroLabel" a reference to the component "MetroFramework" already exists in the project. I do in fact have MetroFramework.Design and MetroFramework.Fonts added to my solution and referenced in my project.

like image 544
Victorio Berra Avatar asked Aug 30 '13 17:08

Victorio Berra


People also ask

How do I install Metro framework?

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.


1 Answers

  1. use nuget to add the modernui to your project.
  2. all forms inherit from MetroFramework.Forms.MetroForm
  3. setup your toolbox panels with the "choose", you have to use browse to navigate and find the metroframework .net dll in the packages folder. pick the one for your build, so .net4 for .net 4 ..etc
  4. that gets you a toolbox panel with "Metrobutton" ..etc.
  5. from that panel drag drop a MetroStyleManager control onto your form. It will keep all the styling on your page the same. then you can set the style and theme once in the constructor. I suggest you make those objects public, then its easy to pass style and theme to any sub windows with ease.

there is a limited set of controls, but should get you started. (I've just played with it for a few hours)

like image 143
cdturner Avatar answered Sep 17 '22 23:09

cdturner