tags:

views:

189

answers:

3

How can we increase the the height and width of a cell in List

It is created using Listcontrol MFC

+1  A: 
  • Write a custom list control (owner drawn).
  • handle message MEASUREITEM_REFLECT
  • set the cell height and width in the method:

MeasureItem( LPMEASUREITEMSTRUCT lpMeasureItemStruct )

aJ
Find a sample here.. http://nibuthomas.com/2009/01/05/changing-row-height-of-a-list-controlclistctrl/
Canopus
+1  A: 

To set the cell width take a look at the *ListView_SetColumnWidth* Win32 function.

One way to set the height is to attach an image list to the list control. The list control will then set the row height based on the height of the icons in the image list.

jussij
A: 

An easy way to set the cell height of a list control is by supplying an image list of the required height:

In the header:

CImageList m_imageList;

In the implementation:

m_imageList.Create(68, 68, ILC_COLOR4, 10, 10); // 68 = cell height in pixels
m_list.SetImageList(&m_imageList, LVSIL_SMALL);

Setting the cell width is achieved by simply calling SetColumnWidth (as pointed out by jussij)

Alan