windowsforms-devexpress-dot-xtraeditors-dot-tileitem-cb4143a8.md
Gets or sets the size of the TileItem.
Namespace : DevExpress.XtraEditors
Assembly : DevExpress.XtraEditors.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DefaultValue(TileItemSize.Default)]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public TileItemSize ItemSize { get; set; }
<DefaultValue(TileItemSize.Default)>
<DXCategory("Appearance")>
<XtraSerializableProperty>
Public Property ItemSize As TileItemSize
| Type | Default | Description |
|---|---|---|
| TileItemSize | Default |
A TileItemSize enumerator value that specifies the size of the TileItem.
|
Available values:
| Name | Description |
|---|---|
| Default |
The default Tile size (equal to the TileItemSize.Wide size).
| | Small |
A rectangular Tile with its side dimensions equal to half of the TileControl.ItemSize property value.
| | Medium |
A square Tile with its dimensions equal to the TileControl.ItemSize property value.
| | Wide |
A rectangular Tile twice as long as a TileItemSize.Medium Tile.
| | Large |
A rectangular tile whose side dimensions are twice as large as the TileControl.ItemSize property value.
|
The ItemSize property specifies the shape and the size of the current TileItem. TileItem sizes are calculated depending on the TileControl.ItemSize property.
The figure below visually illustrates the difference between various Tile sizes.
Wide and Large Tiles can occupy multiple rows depending on the TileItem.RowCount property.
The following code snippet creates a wide tile that occupies 3 rows:
using DevExpress.XtraEditors;
namespace tiles {
public partial class Form1 : XtraForm {
public Form1() {
InitializeComponent();
// Create a tile group
TileGroup tileGroup1 = new TileGroup();
tileGroup1.Text = "Main Menu";
tileControl1.Groups.Add(tileGroup1);
// Create a wide tile
TileItem tileItem1 = new TileItem();
tileItem1.ItemSize = TileItemSize.Wide;
tileItem1.RowCount = 3;
TileItemElement element2 = new TileItemElement { Text = "Reports", TextAlignment = TileItemContentAlignment.MiddleCenter };
tileItem1.Elements.Add(element2);
tileItem1.AppearanceItem.Normal.BackColor = System.Drawing.Color.FromArgb(80, 180, 100);
// Add the tile to the group
tileGroup1.Items.Add(tileItem1);
}
}
}
Imports DevExpress.XtraEditors
Namespace tiles
Partial Public Class Form1
Inherits XtraForm
Public Sub New()
InitializeComponent()
' Create a tile group
Dim tileGroup1 As New TileGroup()
tileGroup1.Text = "Main Menu"
tileControl1.Groups.Add(tileGroup1)
' Create a wide tile
Dim tileItem1 As New TileItem()
tileItem1.ItemSize = TileItemSize.Wide
tileItem1.RowCount = 3
Dim element2 As New TileItemElement() With {
.Text = "Reports",
.TextAlignment = TileItemContentAlignment.MiddleCenter
}
tileItem1.Elements.Add(element2)
tileItem1.AppearanceItem.Normal.BackColor = System.Drawing.Color.FromArgb(80, 180, 100)
' Add the tile to the group
tileGroup1.Items.Add(tileItem1)
End Sub
End Class
End Namespace
See Also