Victorio Berra
Victorio Berra

Reputation: 3105

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.

Upvotes: 8

Views: 45653

Answers (1)

cdturner
cdturner

Reputation: 432

  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)

Upvotes: 23

Related Questions