/// <summary>
        /// 重定位控件
        /// </summary>
        protected void RepositionControls()
        {
            Rectangle rc = this.ClientRectangle;

            if (this.Controls.Count <= 0)
            {
                return;
            }

            int  digitW   = rc.Width / this.Controls.Count;
            bool signFind = false;

            foreach (Control disp in this.Controls)
            {
                if (disp.GetType() == typeof(HMI7Segment))
                {
                    HMI7Segment d = disp as HMI7Segment;

                    int idDigit = 0;
                    if (d.Name.Contains("digit_sign") != false)
                    {
                        signFind = true;
                    }
                    else
                    {
                        if (d.Name.Contains("digit_") != false)
                        {
                            string s = d.Name.Remove(0, 6);
                            idDigit = Convert.ToInt32(s);

                            if (signFind != false)
                            {
                                idDigit++;
                            }
                        }
                    }

                    Point pos = new Point();
                    pos.X      = idDigit * digitW;
                    pos.Y      = 0;
                    d.Location = pos;

                    Size dim = new Size();
                    dim.Width  = digitW;
                    dim.Height = rc.Height;
                    d.Size     = dim;
                }
            }
        }
        /// <summary>
        /// 刷新控件
        /// </summary>
        protected virtual void UpdateControls()
        {
            int count = this.Format.Length;

            this._dpPos = -1;

            char[] seps     = new char[] { '.', ',' };
            int    sepIndex = this.Format.IndexOfAny(seps);

            if (sepIndex > 0)
            {
                count--;
                this._dpPos     = sepIndex - 1;
                this._numDigits = count;
            }

            this._numDigits = count;

            this.Controls.Clear();

            if (this.Signed != false)
            {
                HMI7Segment disp = new HMI7Segment();
                disp.Name  = "digit_sign";
                disp.Value = -1;
                this.Controls.Add(disp);
            }

            for (int idx = 0; idx < count; idx++)
            {
                HMI7Segment disp = new HMI7Segment();

                disp.Name = "digit_" + idx.ToString();

                disp.Click += this.DisplayClicked;

                if (sepIndex - 1 == idx)
                {
                    disp.ShowDP = true;
                }

                this.Controls.Add(disp);
            }

            this.RepositionControls();
        }
        public override void Draw(Graphics Gr)
        {
            if (Gr == null)
            {
                throw new ArgumentNullException("Gr");
            }

            HMI7Segment ctrl = this.Display;

            if (ctrl == null)
            {
                throw new NullReferenceException("Associated control is not valid");
            }

            RectangleF _rc = new RectangleF(0, 0, ctrl.Width, ctrl.Height);

            Gr.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            this.DrawBackground(Gr, _rc);
            this.DrawOffSegments(Gr, _rc);
            this.DrawValue(Gr, _rc);
        }