Back to Devexpress

CustomDrawFrozenPaneBorderEventArgs.Point2 Property

windowsforms-devexpress-dot-xtraspreadsheet-dot-customdrawfrozenpanebordereventargs-dot-point2.md

latest3.5 KB
Original Source

CustomDrawFrozenPaneBorderEventArgs.Point2 Property

Gets the second endpoint of the frozen pane border line.

Namespace : DevExpress.XtraSpreadsheet

Assembly : DevExpress.XtraSpreadsheet.v25.2.dll

NuGet Package : DevExpress.Win.Spreadsheet

Declaration

csharp
public Point Point2 { get; }
vb
Public ReadOnly Property Point2 As Point

Property Value

TypeDescription
Point

A Point structure that specifies the point where the line drawing finishes.

|

Remarks

The CustomDrawFrozenPaneBorderEventArgs.Point1 and Point2 properties return two points that you can use to draw the frozen pane border line.

Example

The following code paints borders of the vertical and horizontal frozen panes in different colors and line widths. The worksheet appears as shown in the image below.

csharp
using System.Drawing;
using System.Windows.Forms;
using DevExpress.XtraSpreadsheet;

// ...

       private void spreadsheetControl1_CustomDrawFrozenPaneBorder
       (object sender, CustomDrawFrozenPaneBorderEventArgs e)
       {
            e.Handled = true;

            // Vertical frozen pane border
            //(line color is pink, line width is 3)
            if (e.Type == FrozenPaneBorderType.Vertical)
                using (Pen pen = new Pen(Color.DeepPink, 3))
                {
                    e.Graphics.DrawLine(pen, e.Point1, e.Point2);
                }

            // Horizontal frozen pane border
            //(line color is violet, line width is default)
            else 
               e.Graphics.DrawLine(Pens.BlueViolet, e.Point1, e.Point2);
        }
vb
Imports Microsoft.VisualBasic
Imports System.Drawing
Imports System.Windows.Forms
Imports DevExpress.XtraSpreadsheet

' ...

    Private Sub spreadsheetControl1_CustomDrawFrozenPaneBorder(ByVal sender As Object, ByVal e As CustomDrawFrozenPaneBorderEventArgs)
        e.Handled = True

        ' Vertical frozen pane border
        '(line color is pink, line width is 3)
        If e.Type = FrozenPaneBorderType.Vertical Then
            Using pen As New Pen(Color.DeepPink, 3)
                e.Graphics.DrawLine(pen, e.Point1, e.Point2)
            End Using

        ' Horizontal frozen pane border
        '(line color is violet, line width is default)
        Else
            e.Graphics.DrawLine(Pens.BlueViolet, e.Point1, e.Point2)
        End If
    End Sub

See Also

CustomDrawFrozenPaneBorderEventArgs Class

CustomDrawFrozenPaneBorderEventArgs Members

DevExpress.XtraSpreadsheet Namespace