Back to Devexpress

BaseGauge.Bounds Property

corelibraries-devexpress-dot-xtragauges-dot-core-dot-model-dot-basegauge-eaa579f9.md

latest3.1 KB
Original Source

BaseGauge.Bounds Property

Gets or sets the gauge’s bounds.

Namespace : DevExpress.XtraGauges.Core.Model

Assembly : DevExpress.XtraGauges.v25.2.Core.dll

NuGet Package : DevExpress.Gauges.Core

Declaration

csharp
public Rectangle Bounds { get; set; }
vb
Public Property Bounds As Rectangle

Property Value

TypeDescription
Rectangle

A Rectangle that specifies the gauge’s bounds.

|

Remarks

The gauge’s bounds cannot be less than the bounds specified by the BaseGauge.MinimumSize property.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Bounds 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.

winforms-linear-gauge-custom-aspect-ratio/CS/WindowsFormsApplication1/Form1.cs#L38

csharp
float proportion = Math.Max(1f, ((targetArea.Width / scaleProportion.Width) / (targetArea.Height / scaleProportion.Height)));
gauge.Bounds = new Rectangle((int)indentX, (int)(indentY + (targetArea.Height - targetArea.Width / 2f / proportion) / 2f), (int)targetArea.Width, (int)(targetArea.Width / 2f / proportion));
gauge.Scales[0].StartPoint = new PointF2D(62.5f, 125f * (1f + proportion));

winforms-linear-gauge-custom-aspect-ratio/VB/WindowsFormsApplication1/Form1.vb#L31

vb
Dim proportion As Single = Math.Max(1F, targetArea.Width / scaleProportion.Width / (targetArea.Height / scaleProportion.Height))
gauge.Bounds = New Rectangle(CInt(indentX), CInt(indentY + (targetArea.Height - targetArea.Width / 2F / proportion) / 2F), CInt(targetArea.Width), CInt(targetArea.Width / 2F / proportion))
gauge.Scales(0).StartPoint = New PointF2D(62.5F, 125F * (1F + proportion))

See Also

BaseGauge Class

BaseGauge Members

DevExpress.XtraGauges.Core.Model Namespace