GrapeCity MultiRow Windows Forms Documentation
ClipBounds Property (SectionPaintingEventArgs)
Example 


Gets the clip area of the current Section that is being painted.
Syntax
Public ReadOnly Property ClipBounds As Rectangle
Dim instance As SectionPaintingEventArgs
Dim value As Rectangle
 
value = instance.ClipBounds
public Rectangle ClipBounds {get;}

Property Value

A System.Drawing.Rectangle value that represents the clip area of the current Section being painted.
Remarks
The ClipBounds property represents the area of the Section that needs to be repainted. For example, if a user covers the entire Section with another window, and then uncovers it, ClipBounds represents the entire Section. If a user covers a small area of the Section, and then uncovers it, ClipBounds represents the small area that was covered.
Example
The following code example shows how to customize a sections paint logic. This code example is part of a larger example provided for the CellPainting event.
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 is 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 is set to true.
            e.Handled = True
        End If
    End Sub
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

SectionPaintingEventArgs Class
SectionPaintingEventArgs Members

 

 


Copyright © GrapeCity, inc. All rights reserved.