当前位置:网站首页>C#--MetroFramework框架调用metroModernUI库,并在工具栏使用
C#--MetroFramework框架调用metroModernUI库,并在工具栏使用
2022-07-25 06:23:00 【黄昏和星空】
在平时我们做winform程序的时候,自带的windows界面并不能满足我们的需求,这个时候就需要借助第三方的一些主题或者控件来解决一下我们的问题,但是大部分的第三方都会收费,一个免费的好用的UI推荐给大家。
电脑一台
Visual Studio 2017
这里新建一个winform程序,可以看到默认的程序窗口是这个样子的,有的时候我们并不喜欢这个窗口的样式或者颜色,接下来跟着小编来改变,如下图:

首先按照下图中红色箭头指示步骤右键点击自己创建的项目,然后点击快捷菜单的 管理NuGet程序包,如下图:

然后选择浏览,并在搜索框中输入 metro,然后点击搜素,然后点击安装MetroModernUI,如下图:

安装结束之后就可以看到 已安装的字样了,如下图:
然后我们查看form1的代码,可以看到Form1是继承自Form的,如下图:
我们修改一下这个这个继承,把Form改为 MetroFramework.Forms.MetroForm,如下图:
然后再看一下我们的窗口设计界面,就会发现,我们的界面已经是另外一种好看的主题了,如下图:
除了更换主题,我们还需要更改相对应的控件,按照下图中红色箭头指示步骤在工具箱的面板上右键点击工具箱中任意一项,然后在弹出的快捷菜单中点击 添加选项卡,如下图:
给新建的 选项卡命名为 Metro,如下图:
然后右键点击新建的选项卡,点击 选择项,如下图:
在弹出的选择工具箱项中按照下图中红色箭头指示位置点击 浏览,如下图:
然后我们刚刚安装的 MetroModernUI就会自带自己的控件库,就在自己的项目下,按照下图指示位置找到这个MetroFramework.dll,然后双击添加,如下图:
可是小编在进行添加的时候遇到了下面的问题,记住,这个时候也不要惊慌,我们还是有解决办法的,如下图:
解决办法就是直接拖住这个MetroFramework.dll直接拖拽到我们的Metro工具箱中,这样也可以添加Metro控件,如下图:
然后我们就可以给metro风格的form添加对应风格的按钮了,如下图:

边栏推荐
- Review of three traversal methods of map
- Tutorial: encryption keys in cloud (using golang and CLI)
- SAP FICO section III BDC and ltmc import S4 financial account
- mysql 查询当前数据库下的表名
- How programmers write bugs
- EXCEL
- [unity3d] ugui callback function
- Learning notes: detailed use of 12864 LCD module
- Dry goods | training AI model can't find data? Collect 20 selected open source communities!
- Pic16f877xa instruction system (assembly language)
猜你喜欢

Use abp Zero builds a third-party login module (III): web side development

【Jailhouse 文章】Base Architectures for virtual-physical computing(2018)

Baidu, Alibaba, Tencent, who fell first?

How to play a data mining game entry Edition

How does vscode enable multiple terminals? How to display horizontally?

Dry goods | training AI model can't find data? Collect 20 selected open source communities!

Addition, deletion, modification and query of DOM elements

Unity 模型简化/合并 一键式插件

JZ7 rebuild binary tree

JTAG debugging source level debugging of arm bare board debugging
随机推荐
函数模板学习记录
How to troubleshoot the problem of too many inodes
Easy to understand: basic knowledge of MOS tube
Pic16f877xa instruction system (assembly language)
[node] the service port is occupied error: listen eaddinuse: address already in use::: 9000- how to close the port started by node
Detailed explanation of arm instruction CMP
Brief introduction of acoustic filter Market
SAP FICO 第三节 BDC和LTMC导入S4财务科目
SAP FICO section III BDC and ltmc import S4 financial account
二叉搜索树(DAY 75)
[QT] solve the problem of Chinese garbled code output from QT console
U-boot-1.1.6 transplant notes (beginner)
What projects can make money online? Is it reliable to be we media?
Sword finger offer 54. the k-th node of the binary search tree
MySQL queries the table name under the current database
【Unity3D】UGUI回调函数
10. Rendering Basics
Sword finger offer 45. arrange the array into the smallest number
JZ7 重建二叉树
Sword finger offer 36. binary search tree and bidirectional linked list