Solved

How to change list view control items height

Posted on 1998-09-04
10
452 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 1

Expert Comment

by:Bridge
ID: 1321721
Just use a bigger font.
0
 
LVL 2

Expert Comment

by:prasanth
ID: 1321722
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
ID: 1321723
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:sudhirbrat
ID: 1321724

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
ID: 1321725
I think listview controls don't send WM_MEASUREITEM messages to their parents. What can i do?

Thanks.

0
 
LVL 1

Expert Comment

by:sudhirbrat
ID: 1321726

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
ID: 1321727
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
ID: 1321728
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
ID: 1321729
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
ID: 13232808
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …

726 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