Exemplo n.º 1
0
        /// <summary>
        /// 控件绘图
        /// </summary>
        /// <param name="e"></param>
        protected override void OnPaint(PaintEventArgs e)
        {
            if (isDraw)
            {
                // 绘制顶部区域
                DrawBackground(e, "top");
                DrawWave(e, "top");

                // 绘制底部区域
                DrawBackground(e, "bottom");
                DrawWave(e, "bottom");

                //绘制日期
                //DrawDateTime(e);

                int count = ctrlData.GetSize();

                // 滚动条设置
                if (!isOnScroll)
                {
                    int maxinum = (count * pix - Width) > 0 ? (count * pix - Width) : 0;
                    hScrollBar1.Maximum = maxinum;
                    hScrollBar1.Value   = maxinum;
                }
            }
        }
Exemplo n.º 2
0
        private void CalcDrawIndex()
        {
            int cnt = (this.Size.Width) / pix;

            if (cnt <= ctrlData.GetSize())
            {
                endIndex   = ctrlData.GetSize();
                beginIndex = ctrlData.GetSize() - cnt;
            }
            else
            {
                beginIndex = 0;
                endIndex   = ctrlData.GetSize() <= 2 ? ctrlData.GetSize() : ctrlData.GetSize() - 1;
            }
        }