Sign in to follow this  

Windows: ListView grid height

Recommended Posts

Hey guys,

I need to have an input grid in my program. I have it working fine except for one detail. The grid itself is of fixed height, and I created it like such:

VialGrid = CreateWindowEx(NULL, WC_LISTVIEW, "", WS_CHILD | WS_BORDER | LVS_REPORT | LVS_EDITLABELS | LBS_NOTIFY, 5, 270, 530, 250, MasterWindowHandle, (HMENU)ID_PDS_VIALGRID, Instance, NULL);
//add gridlines to the vial grid box
ListView_SetExtendedListViewStyle(VialGrid, LVS_EX_GRIDLINES);

So the height of the overall window is 250, and that's where I want it to stay. The problem is the grid at that height displays about 15 and a half rows. I need for it to display exactly 11 rows. Which means I need to change the height of those rows. But I don't see a way to do that. There is a LVM_SETCOLUMNWIDTH message, but I don't see any corresponding LVM_SETROWHEIGHT message. What do I need to do to modify the row heights?

Share this post

Link to post
Share on other sites
Handle WM_MEASURE_ITEM for the list view. Windows will send this to the list views parent once: [url=""]MSDN[/url]

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this