zoukankan      html  css  js  c++  java
  • C#DataGridView 美化

      private void dataGridView(DataGridView dataGridView)
            {
                System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
                System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
                dataGridView.AllowUserToAddRows = false;
                dataGridView.AllowUserToDeleteRows = false;
                dataGridViewCellStyle1.BackColor = System.Drawing.Color.LightCyan;
                dataGridView.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
                dataGridView.BackgroundColor = System.Drawing.Color.White;
                dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
                dataGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
                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;
                dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
                dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
                dataGridView.EnableHeadersVisualStyles = false;
                dataGridView.GridColor = System.Drawing.SystemColors.GradientInactiveCaption;
                dataGridView.ReadOnly = true;
                dataGridView.RowHeadersVisible = false;
                dataGridView.RowTemplate.Height = 23;
                dataGridView.RowTemplate.ReadOnly = true;
                dataGridView.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
            }
    放下电子产品,每天进步一点点
  • 相关阅读:
    网站服务器架构设计
    使用同步或异步的方式完成 I/O 访问和操作(Windows核心编程)
    堆栈上的舞蹈之释放重引用(UAF) 漏洞原理实验分析
    内核模式下的线程同步的分析(Windows核心编程)
    用户模式下的线程同步的分析(Windows核心编程)
    Linux下部署Django项目
    HDU 2075 A|B?
    HDU 2052 Picture
    HDU 2024 C语言合法标识符
    HDU 2026 首字母变大写
  • 原文地址:https://www.cnblogs.com/vienna/p/3450686.html
Copyright © 2011-2022 走看看