Skip to main content

XRControl.LocationF Property

Specifies the floating-point representation of the coordinates of the control’s upper-left corner.

Namespace: DevExpress.XtraReports.UI

Assembly: DevExpress.XtraReports.v22.2.dll

NuGet Package: DevExpress.Reporting.Core

Declaration

[Browsable(false)]
public virtual PointF LocationF { get; set; }

Property Value

Type Description
PointF

A PointF value, specifying the upper-left corner of the control.

Remarks

The control’s upper-left corner is the upper-left corner of the Rectangle object returned by the XRControl.BoundsF property.

A control’s location coordinates within a report are measured in the units set by the XtraReport.ReportUnit property.

A control’s location is determined in reference to the upper-left corner of the XRControl object, returned by the control’s XRControl.Parent property. If this property returns null (Nothing in Visual Basic), the control’s coordinates are always measured in hundredths of inch.

Not all descendants of the XRControl class use the LocationF property. For example, the Band class descendants ignore the LocationF property.

Example

The following example demonstrates how to create an XRControl object and set some of its properties at runtime.

using System.Drawing;
using DevExpress.XtraReports.UI;
// ...

public XRControl CreateMyXRControl() {
    // Create a control.
    XRControl xrControl1 = new XRControl();

    // Set its background color.
    xrControl1.BackColor = Color.LightGray;

    // Set its border color.
    xrControl1.BorderColor = Color.Blue;

    // Make its left and right borders visible.
    xrControl1.Borders = DevExpress.XtraPrinting.BorderSide.Left |
        DevExpress.XtraPrinting.BorderSide.Right;

    // Set its border width (in pixels).
    xrControl1.BorderWidth = 10;

    // Set its location and size (in hundredths of an inch).
    xrControl1.LocationF = new PointF(200F, 100F);
    xrControl1.SizeF = new SizeF(300F, 150F);

    return xrControl1;
}
See Also