Skip to main content
A newer version of this page is available. .

XRControl.BorderWidth Property

Specifies the width of cell borders in pixels, as a floating point value.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v20.2.dll

NuGet Packages: DevExpress.Reporting.Core, DevExpress.WindowsDesktop.Reporting.Core

Declaration

[SRCategory(ReportStringId.CatAppearance)]
public virtual float BorderWidth { get; set; }

Property Value

Type Description
Single

A Single value.

Example

This example demonstrates how to assign custom appearance settings (e.g., XRControl.BackColor, XRControl.ForeColor, XRControl.Borders, XRControl.Font, etc.) to report elements and reset them to their default values, as well as how to make a control ignore its personal appearance settings in favor of the settings of its parent control.

Imports System.Drawing
Imports System.Drawing.Printing
Imports DevExpress.XtraPrinting
Imports DevExpress.XtraReports.UI
' ...
Private Sub xrLabel2_BeforePrint(ByVal sender As Object, _ 
ByVal e As PrintEventArgs) Handles xrLabel2.BeforePrint
    SetCustomStyle(CType(sender, XRLabel))
End Sub

Private Sub xrLabel3_BeforePrint(ByVal sender As Object, _ 
ByVal e As PrintEventArgs) Handles xrLabel3.BeforePrint
    SetCustomStyle(CType(sender, XRLabel))
    ResetStyle(CType(sender, XRLabel))
End Sub

' Assign custom appearance settings to a control.
Private Sub SetCustomStyle(ByVal label As XRLabel)
    label.BackColor = Color.Gray
    label.BorderColor = Color.DarkGray
    label.Borders = BorderSide.All
    label.BorderWidth = 0.5f

    label.Font = New Font(label.Parent.Font, FontStyle.Bold)
    label.ForeColor = Color.White
    label.TextAlignment = TextAlignment.MiddleRight
End Sub

' Restore the appearance settings to their default values.
Private Sub ResetStyle(ByVal label As XRLabel)
    label.ResetBackColor()
    label.ResetBorderColor()
    label.ResetBorders()
    label.ResetBorderWidth()
    label.ResetFont()
    label.ResetForeColor()
    label.ResetPadding()
    label.ResetTextAlignment()
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the BorderWidth property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also