资源简介


资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Datagridview美化
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender EventArgs e)
        {
            this.myDataGrid1.BackgroundImage = Image.FromFile(@“C:\Users\admin\Pictures\Saved Pictures\无标题.jpg“);

            this.myDataGrid1.DefaultCellstyle.BackColor = Color.FromArgb(128 Color.White);

            this.myDataGrid1.DefaultCellstyle.SelectionBackColor = Color.FromArgb(128 Color.Blue);
            EntitySet entitySet = new EntitySet();
            Entity en1 = new Entity(“id1“ “22“ “22“ “22“);
            Entity en2 = new Entity(“id2“ “33“ “33“ “33“);
            Entity en3 = new Entity(“id3“ “44“ “44“ “44“);
            for (int i = 0; i < 20; i++)
            {
                Entity en = new Entity(“11“ “22“ “33“ “44“);
                entitySet.Add(en);
            }
            entitySet.Add(en1);
            entitySet.Add(en2);
            entitySet.Add(en3);
            this.myDataGrid1.DataSource = entitySet;
            this.myDataGrid1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;

            //this.myDataGrid1.BackgroundImage = Image.FromFile(@“C:\Users\泛雅得\Pictures\Camera Roll\timg.jpg“);

            this.DataGridView1.DataSource = entitySet;
            this.DataGridView1.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill;
            func();
        }

       void func()
        {
            #region DataGridVeiw style
            System.Windows.Forms.DataGridViewCellstyle dataGridViewCellstyle1 = new System.Windows.Forms.DataGridViewCellstyle();
            System.Windows.Forms.DataGridViewCellstyle dataGridViewCellstyle2 = new System.Windows.Forms.DataGridViewCellstyle();
            this.DataGridView1.AllowUserToAddRows = false;
            this.DataGridView1.AllowUserToDeleteRows = false;
            dataGridViewCellstyle1.BackColor = System.Drawing.Color.LightCyan;
            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;
            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.Draw

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..A..H.     52736  2021-05-24 14:40  Datagridview美化\.vs\Datagridview美化\v15\.suo

     文件          0  2021-05-24 14:30  Datagridview美化\.vs\Datagridview美化\v15\Server\sqlite3\db.lock

     文件       4096  2021-05-24 14:30  Datagridview美化\.vs\Datagridview美化\v15\Server\sqlite3\storage.ide

     文件      32768  2021-05-24 14:30  Datagridview美化\.vs\Datagridview美化\v15\Server\sqlite3\storage.ide-shm

     文件    1001192  2021-05-24 14:38  Datagridview美化\.vs\Datagridview美化\v15\Server\sqlite3\storage.ide-wal

     文件        187  2019-03-20 13:40  Datagridview美化\Datagridview美化\App.config

     文件      14848  2021-05-24 14:38  Datagridview美化\Datagridview美化\bin\Debug\Datagridview美化.exe

     文件        187  2019-03-20 13:40  Datagridview美化\Datagridview美化\bin\Debug\Datagridview美化.exe.config

     文件      34304  2021-05-24 14:38  Datagridview美化\Datagridview美化\bin\Debug\Datagridview美化.pdb

     文件      24224  2019-03-20 15:47  Datagridview美化\Datagridview美化\bin\Debug\Datagridview美化.vshost.exe

     文件        187  2019-03-20 13:40  Datagridview美化\Datagridview美化\bin\Debug\Datagridview美化.vshost.exe.config

     文件        490  2013-06-18 20:28  Datagridview美化\Datagridview美化\bin\Debug\Datagridview美化.vshost.exe.manifest

     文件       4120  2019-03-20 14:33  Datagridview美化\Datagridview美化\Datagridview美化.csproj

     文件       6763  2021-05-24 14:38  Datagridview美化\Datagridview美化\Form1.cs

     文件       5026  2021-05-24 14:38  Datagridview美化\Datagridview美化\Form1.Designer.cs

     文件       5817  2021-05-24 14:38  Datagridview美化\Datagridview美化\Form1.resx

     文件       2211  2019-03-20 14:53  Datagridview美化\Datagridview美化\Form2.cs

     文件       2000  2019-03-20 14:52  Datagridview美化\Datagridview美化\Form2.Designer.cs

     文件       5817  2019-03-20 14:53  Datagridview美化\Datagridview美化\Form2.resx

     文件         42  2021-05-24 14:30  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.csproj.CoreCompileInputs.cache

     文件       2259  2021-05-24 14:30  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.csproj.FileListAbsolute.txt

     文件       1070  2021-05-24 14:38  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.csproj.GenerateResource.cache

     文件      10843  2021-05-24 14:30  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.csprojAssemblyReference.cache

     文件       2211  2019-03-20 13:44  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.csprojResolveAssemblyReference.cache

     文件      14848  2021-05-24 14:38  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.exe

     文件        180  2021-05-24 14:38  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.Form1.resources

     文件        180  2021-05-24 14:30  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.Form2.resources

     文件      34304  2021-05-24 14:38  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.pdb

     文件        180  2021-05-24 14:30  Datagridview美化\Datagridview美化\obj\Debug\Datagridview美化.Properties.Resources.resources

     文件      17754  2021-05-24 14:38  Datagridview美化\Datagridview美化\obj\Debug\DesignTimeResolveAssemblyReferences.cache

............此处省略28个文件信息

评论

共有 条评论