アクティブセルを反転表示するには?

文書番号 : 11872     文書種別 : 使用方法     最終更新日 : 2003/07/07
文書を印刷する
対象製品
El Tabelle for .NET
詳細
El Tabelle は Excel に基いた動作となっているため、カーソルのあるセルは反転ではなく選択色が透過されて表示されます。カーソルのあるセルを
反転表示するには次のようにコーディングを行う必要があります。

[Visual Basic]
Private Sub Sheet1_EnteredCell(ByVal sender As Object, _
  ByVal e As System.EventArgs) Handles Sheet1.EnteredCell
  Sheet1.ActiveCell.BackColor = Color.Black
  Sheet1.ActiveCell.ForeColor = Color.White
End Sub

Private Sub Sheet1_LeaveCell(ByVal sender As Object, ByVal e _
  As GrapeCity.Views.ElTabelle.LeaveCellEventArgs) _
  Handles Sheet1.LeaveCell
  Sheet1.ActiveCell.BackColor = Color.Empty
  Sheet1.ActiveCell.ForeColor = Color.Black
End Sub


[C#]
private void sheet1_EnteredCell(object sender, System.EventArgs e)
{
  sheet1.ActiveCell.BackColor = Color.Black;
  sheet1.ActiveCell.ForeColor = Color.White;
}

private void sheet1_LeaveCell(object sender, GrapeCity.Views.ElTabelle.LeaveCellEventArgs e)
{
  sheet1.ActiveCell.BackColor = Color.Empty;
  sheet1.ActiveCell.ForeColor = Color.Black;
}


なお、このコーディング例は複数セルの選択には対応していません。
キーワード
HowTo

この文書は、以前は次のFAQ IDで公開されていました : 3644