NavBarCalcGroupClientHeightEventArgs.Height Property
Gets or sets the group’s client area height.
Namespace: DevExpress.XtraNavBar
Assembly: DevExpress.XtraNavBar.v19.1.dll
Declaration
Property Value
Type | Description |
---|---|
Int32 | An integer value specifying the height of the group’s client area in pixels. |
Remarks
When the NavBarGroup.CalcGroupClientHeight event is invoked, the automatically calculated group client area height is assigned to the Height property. Assign a value to this property to implement custom height for the group’ client area.
Example
The following sample code handles the NavBarControl.CustomDrawGroupClientForeground event to custom paint the text on a group’s client foreground. The group doesn’t contain any links initially and thus the NavBarGroup.CalcGroupClientHeight event is handled to specify the group’s height.
The image below shows the result.
using DevExpress.XtraNavBar.ViewInfo;
using DevExpress.XtraNavBar;
private void navBarControl1_CustomDrawGroupClientForeground(object sender,
CustomDrawObjectEventArgs e) {
// Identifying the processed group.
NavGroupClientInfoArgs info = e.ObjectInfo as NavGroupClientInfoArgs;
if (info.Group.Caption != "Support Info") return;
// Specifying the text rectangle.
Rectangle rect = e.RealBounds;
rect.Height /= 4;
// Creating a brush object.
SolidBrush textBrush = new SolidBrush(Color.Black);
// Formatting the output string.
StringFormat outStringFormat = new StringFormat();
outStringFormat.Alignment = StringAlignment.Near;
outStringFormat.LineAlignment = StringAlignment.Center;
// Painting the first string.
rect.Offset(0, rect.Height);
using(textBrush) {
e.Graphics.DrawString("E-mail:", new Font("Verdana", 8, FontStyle.Bold),
textBrush, rect, outStringFormat);
// Painting the second string.
rect.Offset(0, rect.Height);
e.Graphics.DrawString("support@devexpress.com", new Font("Verdana", 8),
textBrush, rect, outStringFormat);
}
// Prohibiting default painting.
e.Handled = true;
}
private void navBarGroup2_CalcGroupClientHeight(object sender,
NavBarCalcGroupClientHeightEventArgs e) {
e.Height = 70;
}
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference 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.