Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. ClistCtrl - centralize image

ClistCtrl - centralize image

Scheduled Pinned Locked Moved C / C++ / MFC
question
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    codepr
    wrote on last edited by
    #1

    I have ClistCtrl (report view) with images. I want the images to be at the center of the column, not at left of the column. How can I centralize the images?

    G 1 Reply Last reply
    0
    • C codepr

      I have ClistCtrl (report view) with images. I want the images to be at the center of the column, not at left of the column. How can I centralize the images?

      G Offline
      G Offline
      Gary R Wheeler
      wrote on last edited by
      #2

      You will need to use 'custom draw', a feature of the common controls including the list control. You can find information in the MSDN using "custom draw" as the search string. I would post a direct link for you, but the MSDN site seems to be acting up at the moment :suss:. Custom draw lets you perform some or all of the drawing required for the control. It's easier than the 'owner draw' feature the traditional controls implemented, where you have to draw the whole thing. With 'custom draw' you can have the control do the standard drawing, and then add your piece where appropriate.


      Software Zen: delete this;

      Fold With Us![^]

      T C 2 Replies Last reply
      0
      • G Gary R Wheeler

        You will need to use 'custom draw', a feature of the common controls including the list control. You can find information in the MSDN using "custom draw" as the search string. I would post a direct link for you, but the MSDN site seems to be acting up at the moment :suss:. Custom draw lets you perform some or all of the drawing required for the control. It's easier than the 'owner draw' feature the traditional controls implemented, where you have to draw the whole thing. With 'custom draw' you can have the control do the standard drawing, and then add your piece where appropriate.


        Software Zen: delete this;

        Fold With Us![^]

        T Offline
        T Offline
        try88
        wrote on last edited by
        #3

        use SetImageList() 路漫漫其修远兮,吾将上下而求索。

        1 Reply Last reply
        0
        • G Gary R Wheeler

          You will need to use 'custom draw', a feature of the common controls including the list control. You can find information in the MSDN using "custom draw" as the search string. I would post a direct link for you, but the MSDN site seems to be acting up at the moment :suss:. Custom draw lets you perform some or all of the drawing required for the control. It's easier than the 'owner draw' feature the traditional controls implemented, where you have to draw the whole thing. With 'custom draw' you can have the control do the standard drawing, and then add your piece where appropriate.


          Software Zen: delete this;

          Fold With Us![^]

          C Offline
          C Offline
          codepr
          wrote on last edited by
          #4

          Thank you! I understand how can I change the font of text for example, by custom draw. But while I process the message of drawing an image, how can I draw the image (icon) at the center of the column?

          G 1 Reply Last reply
          0
          • C codepr

            Thank you! I understand how can I change the font of text for example, by custom draw. But while I process the message of drawing an image, how can I draw the image (icon) at the center of the column?

            G Offline
            G Offline
            Gary R Wheeler
            wrote on last edited by
            #5

            If you know the dimensions of the icon, you can center it based on the RECT passed to the custom draw handler. Use the ::DrawIcon function to draw the icon.


            Software Zen: delete this;

            Fold With Us![^]

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups