zoukankan      html  css  js  c++  java
  • datagridveiw样式

    private void datagridveiw_style()
            {
                System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
                System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
    
                dataGridViewCellStyle1.BackColor = System.Drawing.Color.LightCyan;
    
                dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;//211, 223, 240
                dataGridViewCellStyle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(223)))), ((int)(((byte)(240)))));
                dataGridViewCellStyle2.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
                dataGridViewCellStyle2.ForeColor = System.Drawing.Color.Navy;
                dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
                dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
    
                this.dataGridView1.AllowUserToAddRows = false;
                this.dataGridView1.AllowUserToDeleteRows = false;
                this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
                this.dataGridView1.BackgroundColor = System.Drawing.Color.White;
                this.dataGridView1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
                this.dataGridView1.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
                this.dataGridView1.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
                this.dataGridView1.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                this.dataGridView1.EnableHeadersVisualStyles = false;
                this.dataGridView1.GridColor = System.Drawing.SystemColors.GradientInactiveCaption;
                //this.dataGridView1.ReadOnly = true;
                this.dataGridView1.RowHeadersVisible = true; //建议改为true;为了以后显示序号。
                //this.dataGridView1.RowTemplate.Height = 23;
                //this.dataGridView1.RowTemplate.ReadOnly = true;
                this.dataGridView1.SelectionMode = DataGridViewSelectionMode.FullRowSelect;//设置为整行被选中
            }
    datagridveiw样式
  • 相关阅读:
    Nuget~打包时添加powershell初始化脚本
    ELK系列~对fluentd参数的理解
    arclistsg独立单表模型文档列表
    arcpagelistarclist列表分页
    autochannel 指定栏目
    ini文件解析c库(iniparser)
    POJ 1386 有向图欧拉通路
    最好用的20个数据可视化工具(四)
    各种语音编码总结
    struts2讲义----二
  • 原文地址:https://www.cnblogs.com/qixinjian/p/8529842.html
Copyright © 2011-2022 走看看