影子博客

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

private void FrmLotterycs_Load(object sender, EventArgs e)
{
t = 0;
UserJuanquanTB = O.get_UserJuanquan(empName);

        if (UserJuanquanTB.Rows.Count > 0)
        {
            gridControl1.Height = UserJuanquanTB.Rows.Count * 26+26;
            vScrollBar1.Minimum = -51;
            vScrollBar1.Maximum = gridControl1.Height - panel1.Height;

            gridControl1.DataSource = UserJuanquanTB;
        }

    }

private void vScrollBar1_Scroll(object sender, ScrollEventArgs e)
{
///gridControl1的顶部等于vScrollBar1的值
vScrollBar1.Minimum = 20;
vScrollBar1.Maximum = gridControl1.Height - panel1.Height;
gridControl1.Top = -vScrollBar1.Value;
}

posted on 2016-05-24 10:19  影子博客  阅读(268)  评论(0编辑  收藏  举报