zoukankan      html  css  js  c++  java
  • c# datagridview 背景

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Drawing;
    using System.Data;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    
    namespace OracleTest.CustomControl
    {
        public partial class UserDataGridView : DataGridView
        {
            private Image m_Image;
    
            public UserDataGridView()
            {
                InitializeComponent();
                //this.m_Image = Image.FromFile("C:\\BG.jpg");   
                //this.m_Image = Resources.网格背景;
            }
    
            ///<summary>重写PaintBackground</summary> 
            protected override void PaintBackground(Graphics graphics, Rectangle clipBounds, Rectangle gridBounds)
            {
                base.PaintBackground(graphics, clipBounds, gridBounds);
                graphics.DrawImage(this.m_Image, gridBounds);
            }
    
            /// <summary>设置背景图片</summary> 
            public Image BackImage
            {
                get
                {
                    return this.m_Image;
                }
                set
                {
                    this.m_Image = value;
                    base.Refresh();  // 重新加载   
                }
            }
        }
    } 
  • 相关阅读:
    jsp第七次作业
    jsp第二次作业
    第四次JSP作业
    软件测试练习第一次
    JSP第一次课后作业
    读信息
    购物商城
    页面跳转
    安卓第7周作业
    安卓第六周作业
  • 原文地址:https://www.cnblogs.com/liuxinls/p/3044148.html
Copyright © 2011-2022 走看看