SPREAD for Windows Forms 10.0J サンプルコード集
表示されている先頭行(列)インデックスを取得する

現在シートに表示されているセルの先頭行(列)インデックスを取得するにはFpSpreadクラスのGetViewportTopRowメソッドまたはGetViewportRightColumnメソッドを使用します。

【実行例】

行選択

 private void button1_Click(object sender, System.EventArgs e)
 {

  int TopRow;
  int LeftCol;

  //先頭行(列)インデックスを取得
  TopRow = fpSpread1.GetViewportTopRow(0);
  LeftCol = fpSpread1.GetViewportLeftColumn(0);

  Console.WriteLine("表示されている先頭行インデックスは:" + TopRow.ToString());
  Console.WriteLine("表示されている先頭列インデックスは:" + LeftCol.ToString());

 }
 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

  Dim TopRow As Integer
  Dim LeftCol As Integer

  '先頭行(列)インデックスを取得
  TopRow = FpSpread1.GetViewportTopRow(0)
  LeftCol = FpSpread1.GetViewportLeftColumn(0)

  Console.WriteLine("表示されている先頭行インデックスは:" + TopRow.ToString())
  Console.WriteLine("表示されている先頭列インデックスは:" + LeftCol.ToString())

 End Sub

出力例

表示されている先頭行インデックスは:2

表示されている先頭列インデックスは:0

 

 


© 2004-2017, GrapeCity inc. All rights reserved.