DataGridView设置
设置某行的字体颜色代码:
dataGridView1.Rows[i].DefaultCellStyle.ForeColor=Color.Red;
字体样式:
dataGridView1.DefaultCellStyle.Font = new Font(“隶书”,15);
列标题背景色:
EnableHeadersVisualStyles,将该属性值设置为False 。这个属性表示在对应用程序启用了可视样式的情况下,行标题和列标题是否使用用户当前主题的可视样式,如果为 true的话,自定义的列头颜色会无效。
找到 ColumnHeaderDefaultCellStyle 属性,点击旁边的按钮,打开CellStyle生成器,找到 BackColor 属性,这个属性就是指列头的背景色。
改变DataGridView的左上头部单元内容:
this.dataGridView1.TopLeftHeaderCell.Value = “编号”;
添加DLL控件到工具箱:
1.解决方案添加dll引用
2.选中要添加的工具箱,右击“选显卡”,浏览dll所在位置,添加,即可
combobox 默认值:
this.comboBox1.Selec