How to Use Tile Views

This topic demonstrates how to set the tile view for a list-view control. In tile view, each item is represented by a large icon with one or more lines of accompanying text. For an illustration, see About List-View Controls.

What you need to know



  • C/C++
  • Windows User Interface Programming


Set the general display parameters for tile view by using the ListView_SetTileViewInfo macro. Use the LVTILEVIEWINFO structure that is passed to this macro to specify the position of the text in relation to the icon, the size of each tile (including accompanying text), and the maximum number of lines of text.

If you do not want tiles to be automatically sized, you must set LVTVIF_FIXEDSIZE in the dwFlags member and LVTVIM_TILESIZE in the dwMask member of LVTILEVIEWINFO, as well as providing the dimensions in the sizeTile member.

The following C++ code example sets the tile view info for a list-view control so that a maximum of two subitems are displayed for each item. It also sets the size of each tile.

    SIZE size = { 100, 50 };
    LVTILEVIEWINFO tileViewInfo = {0};

    tileViewInfo.cbSize   = sizeof(tileViewInfo);
    tileViewInfo.dwFlags  = LVTVIF_FIXEDSIZE;
    tileViewInfo.dwMask   = LVTVIM_COLUMNS | LVTVIM_TILESIZE;
    tileViewInfo.cLines   = 2;
    tileViewInfo.sizeTile = size;

    ListView_SetTileViewInfo(hWndListView, &tileViewInfo);

For each item in the list, you can set further parameters when the item is inserted in the list, or later. The LVITEM structure that is used with ListView_InsertItem contains members that specify which columns of data to display below the item, and their alignment. These same display parameters are also found in the LVTILEINFO structure used with ListView_SetTileInfo.

Note  "Columns" here refers not to display columns in tile view but rather to subitems, which are displayed in columns in details view.

Related topics

List-View Control Reference
About List-View Controls
Using List-View Controls