PowerTools MultiRow for Windows Forms 8.0J
RowIndex プロパティ (SectionPaintingEventArgs)
使用例 

イベントが発生したオーナーRowのインデックスを取得します。
構文
Public ReadOnly Property RowIndex As Integer
public int RowIndex {get;}

プロパティ値

イベントが発生したオーナーRowのインデックスを表すSystem.Int32値。ScopeがCellScope.ColumnHeaderまたはCellScope.ColumnFooterの場合、値は-1になります。
使用例
次のサンプルコードは、セクションの描画ロジックをカスタマイズする方法を示します。このサンプルコードは、GcMultiRow.CellPaintingイベントに示されている詳細なコード例の一部を抜粋したものです。
void gcMultiRow_SectionPainting(object sender, SectionPaintingEventArgs e)
{
    if (e.RowIndex == this.gcMultiRow.NewRowIndex && e.Scope == CellScope.Row)
    {
        e.Paint(e.ClipBounds);

        StringFormat sf = new StringFormat();
        sf.Alignment = StringAlignment.Center;

        // Paint string in section face.
        e.Graphics.DrawString("Edit cell in this row to add new rows", gcMultiRow.Font, Brushes.Gray, e.SectionBounds, sf);

        // If you customize the paint logic, make sure, the Handled property should be set to true.
        e.Handled = true;
    }
}
Private Sub gcMultiRow_SectionPainting(ByVal sender As Object, ByVal e As SectionPaintingEventArgs) Handles gcMultiRow.SectionPainting
    If e.RowIndex = Me.gcMultiRow.NewRowIndex AndAlso e.Scope = CellScope.Row Then
        e.Paint(e.ClipBounds)

        Dim sf As New StringFormat()
        sf.Alignment = StringAlignment.Center

        ' Paint string in section face.
        e.Graphics.DrawString("Edit cell in this row to add new rows", gcMultiRow.Font, Brushes.Gray, e.SectionBounds, sf)

        ' If you customize the paint logic, make sure, the Handled property should be set to true.
        e.Handled = True
    End If
End Sub
参照

SectionPaintingEventArgs クラス
SectionPaintingEventArgs メンバ

 

 


© 2008-2015 GrapeCity inc. All rights reserved.