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. Header control

Header control

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 5 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.
  • A Offline
    A Offline
    Ali Tavakol
    wrote on last edited by
    #1

    how can I change alignment of columns of header control? (not text of columns) I want the fist column be shown in the right of list box.

    K D 2 Replies Last reply
    0
    • A Ali Tavakol

      how can I change alignment of columns of header control? (not text of columns) I want the fist column be shown in the right of list box.

      K Offline
      K Offline
      khan
      wrote on last edited by
      #2

      You already created a thread for your question below. I don't understand your question. Could you rephrase it? Do you mean the text in the header control's alignment: left-align, center-align, right-align? this is this.

      A 1 Reply Last reply
      0
      • K khan

        You already created a thread for your question below. I don't understand your question. Could you rephrase it? Do you mean the text in the header control's alignment: left-align, center-align, right-align? this is this.

        A Offline
        A Offline
        Ali Tavakol
        wrote on last edited by
        #3

        when you create the fist column of the header control, it appearers at the topleft of listbox (regardless of the alignment of its text). when you create another column, it appears in right of the first one. I want the first column be appeared at the topright.

        T J 2 Replies Last reply
        0
        • A Ali Tavakol

          when you create the fist column of the header control, it appearers at the topleft of listbox (regardless of the alignment of its text). when you create another column, it appears in right of the first one. I want the first column be appeared at the topright.

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

          read more carefully about the method int InsertItem( int nPos, HDITEM* phdi ); it provides all you what 路漫漫其修远兮,吾将上下而求索。

          A 1 Reply Last reply
          0
          • T try88

            read more carefully about the method int InsertItem( int nPos, HDITEM* phdi ); it provides all you what 路漫漫其修远兮,吾将上下而求索。

            A Offline
            A Offline
            Ali Tavakol
            wrote on last edited by
            #5

            read carefully my question! I want to apply right to left order to columns, not to text of items.

            1 Reply Last reply
            0
            • A Ali Tavakol

              when you create the fist column of the header control, it appearers at the topleft of listbox (regardless of the alignment of its text). when you create another column, it appears in right of the first one. I want the first column be appeared at the topright.

              J Offline
              J Offline
              Jack Puppy
              wrote on last edited by
              #6

              Just use zero for the index when you insert the columns. InsertColumn(0, _T("Column far right")); InsertColumn(0, _T("Column 2nd from right")); InsertColumn(0, _T("Column 3rd from right")); If you need it so the entire list control is flush with the right side on the control (say for arabic/hebrew reading) you'd need to set the Right to Left RTL Layout setting in the dialog that contains the control. In Italy for thirty years under the Borgias they had warfare, terror, murder, bloodshed - but they produced Michelangelo, Leonardo da Vinci and the Renaissance. In Switzerland they had brotherly love, five hundred years of democracy and what did that produce - the cuckoo clock! -- Harry Lime

              1 Reply Last reply
              0
              • A Ali Tavakol

                how can I change alignment of columns of header control? (not text of columns) I want the fist column be shown in the right of list box.

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Insert a temporary column first, insert the other columns, then delete the temporary column, like:

                m_lcFooter.InsertColumn(0, _T("David")); // temporary
                m_lcFooter.InsertColumn(1, _T("Right Justified"), LVCFMT_RIGHT, 580);
                m_lcFooter.InsertColumn(2, _T("Left Justified"), LVCFMT_LEFT, 75);
                m_lcFooter.DeleteColumn(0);
                // now insert the items


                "One must learn from the bite of the fire to leave it alone." - Native American Proverb

                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