Back to Devexpress

TileItem.ItemSize Property

windowsforms-devexpress-dot-xtraeditors-dot-tileitem-cb4143a8.md

latest5.4 KB
Original Source

TileItem.ItemSize Property

Gets or sets the size of the TileItem.

Namespace : DevExpress.XtraEditors

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(TileItemSize.Default)]
[DXCategory("Appearance")]
[XtraSerializableProperty]
public TileItemSize ItemSize { get; set; }
vb
<DefaultValue(TileItemSize.Default)>
<DXCategory("Appearance")>
<XtraSerializableProperty>
Public Property ItemSize As TileItemSize

Property Value

TypeDefaultDescription
TileItemSizeDefault

A TileItemSize enumerator value that specifies the size of the TileItem.

|

Available values:

NameDescription
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.

|

Remarks

The ItemSize property specifies the shape and the size of the current TileItem. TileItem sizes are calculated depending on the TileControl.ItemSize property.

  • Small - a square Tile with side dimension of half the TileControl.ItemSize property value.
  • Medium - a square Tile with side dimension equal to the TileControl.ItemSize property value. This is the default Tile size.
  • Wide - a rectangular Tile with its lesser side equal to the TileControl.ItemSize property value and its larger side twice as big as the lesser side.
  • Large - an extra large square Tile with side dimensions twice as large as the TileControl.ItemSize property value.

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:

csharp
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);
        }
    }
}
vb
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

ItemSize

TileItem Class

TileItem Members

DevExpress.XtraEditors Namespace