关闭

Eidt Value setting

201人阅读 评论(0) 收藏 举报
分类:
        /// <summary>
        /// Set SpinEdit integer format.
        /// </summary>
        /// <param name="editControl">SpinEdit Control</param>
        /// <param name="minValue">Min Value</param>
        /// <param name="maxValue">Max Value</param>
        public static void SetIntegerFormat(this SpinEdit editControl, int minValue, int maxValue) {
            if (editControl == null)
                throw new ArgumentNullException("editControl");

            SetIntegerFormat(editControl, minValue, maxValue, minValue);
        }

        /// <summary>
        /// Set SpinEdit integer format.
        /// </summary>
        /// <param name="editControl">SpinEdit Control</param>
        /// <param name="minValue">Min Value</param>
        /// <param name="maxValue">Max Value</param>
        public static void SetIntegerFormat(this SpinEdit editControl, int minValue, int maxValue, int defaultValue) {
            if (editControl == null)
                throw new ArgumentNullException("editControl");

            editControl.Properties.IsFloatValue = false;
            editControl.Properties.Mask.EditMask = "N0";
            editControl.Properties.DisplayFormat.FormatType = FormatType.Numeric;
            editControl.Properties.DisplayFormat.FormatString = "N0";
            editControl.Properties.EditFormat.FormatType = FormatType.Numeric;
            editControl.Properties.EditFormat.FormatString = "N0";
            editControl.Properties.MinValue = minValue;
            editControl.Properties.MaxValue = maxValue;
            editControl.Value = defaultValue;
        }


 LotQtySpinEdit.SetIntegerFormat(1, 999999, 1);

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:508164次
    • 积分:6645
    • 等级:
    • 排名:第3708名
    • 原创:91篇
    • 转载:291篇
    • 译文:67篇
    • 评论:41条
    最新评论
    .NET学习