zoukankan      html  css  js  c++  java
  • winform 多个datagridview 之间同步滚动

    1.添加Scroll事件

    2.注意需判断数据长度,避免溢出

    private void dgYY_Scroll(object sender, ScrollEventArgs e)
            {
                if (this.dgFee.RowCount > 0)
                {
                    dgFee.FirstDisplayedScrollingRowIndex = Math.Min(dgYY.FirstDisplayedScrollingRowIndex, this.dgFee.RowCount - 1);
                    dgFee.HorizontalScrollingOffset = dgYY.HorizontalScrollingOffset;
                }
            }
    
            private void dgFee_Scroll(object sender, ScrollEventArgs e)
            {
                if (this.dgYY.RowCount > 0)
                {
                    dgYY.FirstDisplayedScrollingRowIndex = Math.Min(dgFee.FirstDisplayedScrollingRowIndex, this.dgYY.RowCount - 1);
                    dgYY.HorizontalScrollingOffset = dgFee.HorizontalScrollingOffset;
                }
            }
  • 相关阅读:
    CodeForces
    CodeForces
    AtCoder
    AtCoder
    CodeForces
    CodeForces
    CodeForces
    CodeForces
    Centos7配置yum国内镜像及仓库升级
    环境变量
  • 原文地址:https://www.cnblogs.com/jasonlai2016/p/11038007.html
Copyright © 2011-2022 走看看