DonkingControlBase/LookupEditor/BxTextBox.cs

(完整代码) 1KB

/*
 * Author donking
 * http://www.donking-ch.com/ 
 */

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

namespace DonkingControlBase
{
    /// <summary>
    /// 继承TextBox带下划线的输入框
    /// </summary>
    public partial class BxTextBox : System.Windows.Forms.TextBox
    {
        public BxTextBox()
        {
            this.BorderStyle = BorderStyle.None;
        }

        private int WM_PAINT = 0x000F;

        //使TextBox带下划线
        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);
            if (m.Msg == WM_PAINT)
            {
                Pen pen = new Pen(Brushes.Black, 1.5f);

                using (Graphics g = this.CreateGraphics())
                {
                    g.DrawLine(pen, new Point(0, this.Size.Height - 1), new Point(this.Size.Width, this.Size.Height - 1));
                }
            }
        }  
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。