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;
            }
    放下电子产品,每天进步一点点
  • 相关阅读:
    The bean ‘XXXXX.FeignClientSpecification‘ could not be registered.
    爱数产品
    RSA加解密时报algid parse error, not a sequence错误
    PostgreSQL 查看数据库,索引,表,表空间大小
    Vue3工程示例
    Vue3工程用Vue2示例
    Vue工程添加组件调用
    Vue 项目结构
    命令行创建Vue项目
    Vue 自定义指令
  • 原文地址:https://www.cnblogs.com/vienna/p/3450686.html
Copyright © 2011-2022 走看看