windowsforms-devexpress-dot-xtradiagram-dot-diagramitem-662ecd4c.md
Gets or sets the item height.
Namespace : DevExpress.XtraDiagram
Assembly : DevExpress.XtraDiagram.v25.2.dll
NuGet Package : DevExpress.Win.Diagram
[DXCategory("Layout")]
[Browsable(false)]
public virtual float Height { get; set; }
<DXCategory("Layout")>
<Browsable(False)>
Public Overridable Property Height As Single
| Type | Description |
|---|---|
| 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.
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
customContainer.Width = (float)containingRect.Width;
customContainer.Height = (float)containingRect.Height;
}
winforms-diagram-create-rotatable-containers-with-shapes/CS/WindowsFormsApp4/Form1.cs#L45
container.Width = (float)containingRect.Width;
container.Height = (float)containingRect.Height;
}
winforms-diagram-track-and-restrict-drag-actions/CS/WinApp7/Form1.cs#L52
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
shapeItem.Width = 40;
shapeItem.Height = e.Bounds.Height;
diagramControl1.DrawDetachedItem(shapeItem, e.Cache);
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
customContainer.Width = CSng(containingRect.Width)
customContainer.Height = CSng(containingRect.Height)
End If
winforms-diagram-create-rotatable-containers-with-shapes/VB/WindowsFormsApp4/Form1.vb#L49
container.Width = CSng(containingRect.Width)
container.Height = CSng(containingRect.Height)
End If
winforms-diagram-create-custom-toolbox/VB/CustomDiagramToolboxExample/Form1.vb#L46
shapeItem.Width = 40
shapeItem.Height = e.Bounds.Height
Me.diagramControl1.DrawDetachedItem(shapeItem, e.Cache)
See Also