How to change list view control items height

How can i change list view control items height in report mode?

Thanks in advance.
fjsenAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
sudhirbratConnect With a Mentor Commented:
If you try in this, the problem may be solved.

Derive your own list control class from CListCtrl and override WM_MEASUREITEM.

Subclass your list control in the dialog to your derived class.
0
 
BridgeCommented:
Just use a bigger font.
0
 
prasanthCommented:
One way is to SetImageList with a bitmap that is the height that you want the row to be. If you don't really want images but just the height, use a bitmap 1 pixel wide and the height you want filled with the background color of the image list.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
fjsenAuthor Commented:
I don't want a workaround to set the height throught SetImageList. I want to set the height with something like this: SetItemHeight(int iHeight). I don't want to use images.

Thanks.

0
 
sudhirbratCommented:

fjsen,

Override the message WM_MEASUREITEM in the class where you have the list control.

There you have MEASUREITEMSTRUCT structure as argument.
This structure has the height variable.

If the control ID is of list control set height of structure.
0
 
fjsenAuthor Commented:
I think listview controls don't send WM_MEASUREITEM messages to their parents. What can i do?

Thanks.

0
 
sudhirbratCommented:

The list control style must be "OwnerDraw Fixed".
Check this style in Properties dialog.
And you need to draw the items in the list control. To do this you need to override WM_DRAWITEM meesage also.

the message "WM_MEASUREITEM" is called by list control only at the creation of list control and when resizing the control with the help of functions like "MoveWindow".

This worked fine for me.
0
 
fjsenAuthor Commented:
Sorry, but i don't want to draw the items in the list control. I don't want an ownerdraw list control.

Thanks.

0
 
fjsenAuthor Commented:
I've derived my own class from CListCtrl and handled the WM_MEASUREITEM message. I don't receive this message if the control isn't ownerdraw. I don't want to draw items.

Thanks.

0
 
ashugarg00Commented:
In a owner draw list conrol we cannot set the LVS_OWNERDRAWVARIABLE flag to change the item height.please confirm and let me know!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.