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
Solved

How to change list view control items height

Posted on 1998-09-04
10
445 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
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Login Script to Copy Folders 12 42
Tab names are off by one 5 54
FizzBuzz challenge 9 82
mapBully challenge 6 152
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

839 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