dgv.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter;
解决方案 »
- 多线程问题,子线程访问主线程控件,修改内容不实时!
- winform如果在窗体打开一张表,对字段内容进行判断?
- RDLC报表的控件坐标怎么在程序中修改??
- run(new Form1())?????????????
- 急求个sql语句!!!
- 推荐一本关于C#项目实目开发的书!!(进来介绍者都有分,不够再加)
- 请问:我要计算学生的成绩,有的是80,有的是80.5分,均分要83.24,小数位不定,怎么办啊?
- 新手VS2005开发wap疑问..
- 请指教!!!!!!!
- 在C#里要怎么样才可以让一个窗体一打开就最大化?
- WPF大疑问??????????
- TreeView 的节点的Expand() 为啥不好使
this.grdPath.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Sunken;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("宋体", 9F,
System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
dg1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells);列标题对齐,直接修改属性ColumnHeadersDefaultCellStyle.Alignment 设置为 MiddleCenter