1
wei
2021-06-02 1396007184e3e17c2465b1fea5ba5562daf7d157
HDL_ON/UI/UI0-Stan/Controls/BaseControl/ButtonCtrBase.cs
@@ -74,6 +74,54 @@
            }
        }
        /// <summary>
        /// 选中状态(重写底层属性)
        /// </summary>
        public new bool IsSelected
        {
            get { return base.IsSelected; }
            set
            {
                //只有状态不一样,才变更
                if (base.IsSelected != value)
                {
                    base.IsSelected = value;
                }
            }
        }
        /// <summary>
        /// 非选中状态的背景图路径(重写底层属性)
        /// </summary>
        public new string UnSelectedImagePath
        {
            get { return base.UnSelectedImagePath; }
            set
            {
                //只有图片不一样,才变更
                if (base.UnSelectedImagePath != value)
                {
                    base.UnSelectedImagePath = value;
                }
            }
        }
        /// <summary>
        /// 选中状态的背景图路径(重写底层属性)
        /// </summary>
        public new string SelectedImagePath
        {
            get { return base.SelectedImagePath; }
            set
            {
                //只有图片不一样,才变更
                if (base.SelectedImagePath != value)
                {
                    base.SelectedImagePath = value;
                }
            }
        }
        #endregion
        #region ■ 初始化_____________________________
@@ -312,13 +360,18 @@
        /// <summary>
        /// 根据文本,计算它需要的总行数
        /// </summary>
        /// <param name="i_width">当值为-1时,需要父控件,真实值</param>
        /// <returns></returns>
        public int GetRealRowCountByText()
        public int GetRealRowCountByText(int i_width = -1)
        {
            if (i_width == -1)
            {
                i_width = this.Width;
            }
            //先获取它的真实宽度
            int realWidth = this.GetRealWidthByText();
            int row = realWidth / this.Width;
            if (realWidth % this.Width > 0)
            int row = realWidth / i_width;
            if (realWidth % i_width > 0)
            {
                row++;
            }