https://www.cnblogs.com/mingjiatang/p/5940826.html
该链接跳转到一个较为详细的使用介绍界面
下面是一个小例子:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevComponents.DotNetBar; 第一步
namespace SingleDemo
{
public partial class Form1 : Office2007Form 第二步
{
MySQLConn conn = new MySQLConn();
public Form1()
{
this.EnableGlass = false;//关键, 第三步
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
注意:给combobox动态添加项的时候必须得写在InitializeComponent();的后面,否则会,报combobox空指针异常
窗体加载的时候,先执行构造方法,再执行load方法
string[] skinNames = { "Office2007Blue", "Office2007Silver", "Office2007Black", "Office2010Silver", "Office2013" };
string sql = "select * from student";
//动态给comboboxEx添加项
foreach (string skin in skinNames)
{
this.combo.Items.Add(skin);
}
dataGridView1.DataSource = conn.ExceuteQuery(sql);
}
private void buttonX1_Click(object sender, EventArgs e)
{
switch (this.combo.Text)
{
case "Office2007Blue":
this.styleManager1.ManagerStyle = eStyle.Office2007Blue;
break;
case "Office2007Silver":
this.styleManager1.ManagerStyle = eStyle.Office2007Silver;
break;
case "Office2007Black":
this.styleManager1.ManagerStyle = eStyle.Office2007Black;
break;
case "Office2010Silver":
this.styleManager1.ManagerStyle = eStyle.Office2010Silver;
break;
case "Office2013":
this.styleManager1.ManagerStyle = eStyle.Office2013;
break;
}
}
}
}