VB.net 2010 视频教程 VB.net 2010 视频教程 python基础视频教程
SQL Server 2008 视频教程 c#入门经典教程 Visual Basic从门到精通视频教程
当前位置:
首页 > Python基础教程 >
  • C1FlexGrid双grid滚动条联动

利用AfterScroll事件,来实现双grid联动。

复制代码
 1  private void Grid_AfterScroll(object sender, RangeEventArgs e)
 2  {
 3      try
 4      {
 5          if (!_Interlocking)
 6          {
 7              // スクロール連動の排他的制御
 8              _Interlocking = true;
 9  
10              FlexGridFMS grid = sender as FlexGridFMS;
11              grid.Update();
12              Point pt = grid.ScrollPosition;
13  
14              // 横のみ連動させる
15              if (grid.Equals(grdData))
16              {
17                  grdDataSub.ScrollPosition = new Point(pt.X, grdDataSub.ScrollPosition.Y);
18              }
19              else if (grid.Equals(grdDataSub))
20              {
21                  grdData.ScrollPosition = new Point(pt.X, grdData.ScrollPosition.Y);
22              }
23  
24              this.Invalidate();
25              this.Update();
26  
27              _Interlocking = false;
28          }
29      }
30      catch (Exception ex)
31      {
32          ErrorProc(ex);
33      }
34  }
复制代码


相关教程