アクティブセルを反転表示するには?
対象製品
El Tabelle for .NET
詳細
El Tabelle は Excel に基いた動作となっているため、カーソルのあるセルは反転ではなく選択色が透過されて表示されます。カーソルのあるセルを
反転表示するには次のようにコーディングを行う必要があります。
[Visual Basic]
[C#]
なお、このコーディング例は複数セルの選択には対応していません。
反転表示するには次のようにコーディングを行う必要があります。
[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
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;
}
{
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