src/Core/Controls/XRails_TextBox.cs

(开头部分) 13KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*  XRails_TextBox.cs
**  Copyright (C) 2017, Jad Altahan
** 
**  This software may be modified and 
**  distributed under the terms of the
**  MIT license. See the LICENSE file
**  for details.
** 
**  http://github.com/xv
**  mailto:xviyy@aol.com
*/

using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System;

namespace XRails.Controls
{
    [DefaultEvent("TextChanged")]
    public class XRails_TextBox : Control
    {
        #region Fields

        private TextBox tbCtrl = new TextBox();
        private Color borderColor;
        private Panel watermarkContainer;

        #endregion
        #region Properties

        [Browsable(true)]
        [Description("Decides whether the top and bottom border lines are recolored on Enter event.")]
        public bool ColorBordersOnEnter { get; set; } = true;

        private Image _Image;
        [Browsable(true)]
        [Description("The image displayed in the TextBox.")]
        public Image Image
        {
            get { return _Image; }
            set
            {
                _Image = value;
                ImageSize = value == null ? Size.Empty : value.Size;
                tbCtrl.Location = new Point(24, 14);

                Invalidate();
            }
        }

        protected Size ImageSize { get; private set; }

        private int _MaxLength = 32767;
        [Browsable(true)]
        [Description("Specifies the maximum number of characters that can be entered into the edit control.")]
        public int MaxLength
        {
            get { return _MaxLength; }
            set
后面还有 408 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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