Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1908
  • Last Modified:

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

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
zabbas
Asked:
zabbas
  • 3
  • 3
1 Solution
 
AndyAinscowFreelance programmer / ConsultantCommented:
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
 
zabbasAuthor Commented:
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
 
AndyAinscowFreelance programmer / ConsultantCommented:
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
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
zabbasAuthor Commented:
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
 
AndyAinscowFreelance programmer / ConsultantCommented:
OK.
0
 
zabbasAuthor Commented:
I guess no one has solution for this. So i have no choice but to accept the try from AndyAinscow.

Thanks.
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.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now