Solved

How to change list view control items height

Posted on 1998-09-04
10
443 Views
Last Modified: 2013-11-20
How can i change list view control items height in report mode?

Thanks in advance.
0
Comment
Question by:fjsen
10 Comments
 
LVL 1

Expert Comment

by:Bridge
Comment Utility
Just use a bigger font.
0
 
LVL 2

Expert Comment

by:prasanth
Comment Utility
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
 

Author Comment

by:fjsen
Comment Utility
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
 
LVL 1

Expert Comment

by:sudhirbrat
Comment Utility

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
 

Author Comment

by:fjsen
Comment Utility
I think listview controls don't send WM_MEASUREITEM messages to their parents. What can i do?

Thanks.

0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 1

Expert Comment

by:sudhirbrat
Comment Utility

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
 

Author Comment

by:fjsen
Comment Utility
Sorry, but i don't want to draw the items in the list control. I don't want an ownerdraw list control.

Thanks.

0
 
LVL 1

Accepted Solution

by:
sudhirbrat earned 50 total points
Comment Utility
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
 

Author Comment

by:fjsen
Comment Utility
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
 

Expert Comment

by:ashugarg00
Comment Utility
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

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now