Back to Devexpress

DiagramItem.Height Property

windowsforms-devexpress-dot-xtradiagram-dot-diagramitem-662ecd4c.md

latest5.7 KB
Original Source

DiagramItem.Height Property

Gets or sets the item height.

Namespace : DevExpress.XtraDiagram

Assembly : DevExpress.XtraDiagram.v25.2.dll

NuGet Package : DevExpress.Win.Diagram

Declaration

csharp
[DXCategory("Layout")]
[Browsable(false)]
public virtual float Height { get; set; }
vb
<DXCategory("Layout")>
<Browsable(False)>
Public Overridable Property Height As Single

Property Value

TypeDescription
Single

A Single value, specifying the item height in pixels.

|

The following code snippets (auto-collected from DevExpress Examples) contain references to the Height 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.

how-to-use-the-customdrawitem-event-to-draw-custom-icons-inside-diagram-items-t441104/CS/XtraDiagram.CustomDraw/Form1.cs#L44

csharp
var margin = 3f;
e.Graphics.DrawImage(image, new RectangleF(shape.Width - image.Width - margin, shape.Height - image.Height - margin, image.Width, image.Height));
e.Handled = true;

winforms-diagram-proportionally-resize-shapes-within-container/CS/WindowsFormsApp4/Form1.cs#L46

csharp
customContainer.Width = (float)containingRect.Width;
    customContainer.Height = (float)containingRect.Height;
}

winforms-diagram-create-rotatable-containers-with-shapes/CS/WindowsFormsApp4/Form1.cs#L45

csharp
container.Width = (float)containingRect.Width;
    container.Height = (float)containingRect.Height;
}

winforms-diagram-track-and-restrict-drag-actions/CS/WinApp7/Form1.cs#L52

csharp
if (item.Item is DiagramShape shape && shape.Shape == BasicShapes.Pentagon) {
    var itemRect = new System.Windows.Rect(new System.Windows.Point(item.NewDiagramPosition.X, item.NewDiagramPosition.Y), new System.Windows.Size(item.Item.Width, item.Item.Height));
    foreach (var diagramShape in diagramControl1.Items.OfType<DiagramShape>().Where(x => x != shape)) {

winforms-diagram-create-custom-toolbox/CS/CustomDiagramToolboxExample/Form1.cs#L45

csharp
shapeItem.Width = 40;
shapeItem.Height = e.Bounds.Height;
diagramControl1.DrawDetachedItem(shapeItem, e.Cache);

how-to-use-the-customdrawitem-event-to-draw-custom-icons-inside-diagram-items-t441104/VB/XtraDiagram.CustomDraw/Form1.vb#L40

vb
Dim margin = 3F
e.Graphics.DrawImage(image, New RectangleF(shape.Width - image.Width - margin, shape.Height - image.Height - margin, image.Width, image.Height))
e.Handled = True

winforms-diagram-proportionally-resize-shapes-within-container/VB/WindowsFormsApp4/Form1.vb#L48

vb
customContainer.Width = CSng(containingRect.Width)
    customContainer.Height = CSng(containingRect.Height)
End If

winforms-diagram-create-rotatable-containers-with-shapes/VB/WindowsFormsApp4/Form1.vb#L49

vb
container.Width = CSng(containingRect.Width)
    container.Height = CSng(containingRect.Height)
End If

winforms-diagram-create-custom-toolbox/VB/CustomDiagramToolboxExample/Form1.vb#L46

vb
shapeItem.Width = 40
shapeItem.Height = e.Bounds.Height
Me.diagramControl1.DrawDetachedItem(shapeItem, e.Cache)

See Also

Width

Size

DiagramItem Class

DiagramItem Members

DevExpress.XtraDiagram Namespace