zoukankan      html  css  js  c++  java
  • 扩展控件属性

    1、创建用户控件项目

    2、    注释以下这一行 

            private void InitializeComponent()
            {
                components = new System.ComponentModel.Container();
                //this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            }

        public partial class ExLabel : Label

        {

            public ExLabel()

            {

                InitializeComponent();

                this.Click += new EventHandler(exLabel_Click); 

            }

               protected override void OnMouseEnter(System.EventArgs e)  

               {  

                   base.OnMouseEnter(e);

                   this.ForeColor = Color.Black;

                   this.BackColor = Color.White;

                //this.Font = new Font("宋体", 10F, FontStyle.Underline);  

               }  

      

             protected override void OnMouseLeave(System.EventArgs e)  

              {  

                  base.OnMouseLeave(e);

                  this.ForeColor = Color.White;

                  this.BackColor = Color.Black;

                  //this.Font = new Font("宋体", 10F, FontStyle.Regular);  

              }

             private void exLabel_Click(object sender, EventArgs e)

             {

                 this.ForeColor = Color.Magenta;

                 //this.BackColor = Color.Blue;

             }

  • 相关阅读:
    all the tops
    es6 and typescript
    [leetcode]question5: Longest Palindromic Substring
    webpack and publish lib
    HTTPClient to use http/https protocol to send request
    《算法导论》-分治法-笔记
    《Linux C编程一站式学习》-笔记
    WIN7中同时打开多个独立Excel窗口
    RAD Studio XE6之Tpanel
    vb中StatusBar1.Panels(3).Text = Format(Date, "yyyy年mm月dd日")是什么意思
  • 原文地址:https://www.cnblogs.com/xihong2014/p/4208960.html
Copyright © 2011-2022 走看看