Solved

How to center align 'subitem image' in a List Control

Posted on 2006-06-11
6
1,806 Views
Last Modified: 2013-11-20
Is it possible to center align the subitem image (no text in subitem) in a List control (CListCtrl)? CListCtrl::SetItem() doesn't seem to do so. Help please!
0
Comment
Question by:zabbas
[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
  • 3
  • 3
6 Comments
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 125 total points
ID: 16883393
Are you using it in report mode?

Just a guess - have you tried the LVCFMT_CENTER option when preparing the column headers.

      LVCOLUMN lvc;

      lvc.mask = LVCF_SUBITEM  | LVCF_FMT;   //add whatever other flags you require
      lvc.fmt = LVCFMT_CENTER;   //add whatever other flags you require


It might not work - if it doesn't then all I can suggest is an owner-draw list control.
0
 

Author Comment

by:zabbas
ID: 16884223
Yes I am using it in report mode.

Yes I have tried LVCFMT_CENTER when inserting columns but it appears to be aligning the text and not the images.

Owner-draw is an option but I have not much time to do in that way.

Thanks for your input.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 16884259
It was a long shot (the LVCFMT_CENTER).

Do you want to wait and see if someone else has a suggestion or do you need help with the owner draw?
0
Industry Leaders: 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!

 

Author Comment

by:zabbas
ID: 16884788
For the moment I am not planning to (re)do all the stuff using owner draw lists. So i'll wait for couple of days to see if someone else has any suggestion (chances are very dim).
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 16885299
OK.
0
 

Author Comment

by:zabbas
ID: 16922002
I guess no one has solution for this. So i have no choice but to accept the try from AndyAinscow.

Thanks.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

635 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