简体   繁体   中英

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.

  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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM