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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CListCtrl question

CListCtrl question

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
10 Posts 5 Posters 1 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
    ArielR
    wrote on last edited by
    #1

    I'm working in VC++6. How can i do to set the cursor in a row position of CLisCtrl? That way, if the user press down or up arroy the movement starts from the designated position. I can use the CListCtrl.EnsureVisible( iPos, TRUE) to ensure visibility but the movement starts from the begin. Thanks a lot.

    G 1 Reply Last reply
    0
    • A ArielR

      I'm working in VC++6. How can i do to set the cursor in a row position of CLisCtrl? That way, if the user press down or up arroy the movement starts from the designated position. I can use the CListCtrl.EnsureVisible( iPos, TRUE) to ensure visibility but the movement starts from the begin. Thanks a lot.

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

      Try using list.SetItemState(iPos,LVIS_FOCUSED,LVIS_FOCUSED). See CListCtrl::SetItemState[^] for more information.


      Software Zen: delete this;

      A 1 Reply Last reply
      0
      • G Gary Wheeler

        Try using list.SetItemState(iPos,LVIS_FOCUSED,LVIS_FOCUSED). See CListCtrl::SetItemState[^] for more information.


        Software Zen: delete this;

        A Offline
        A Offline
        ArielR
        wrote on last edited by
        #3

        Thank you very much!

        G 1 Reply Last reply
        0
        • A ArielR

          Thank you very much!

          G Offline
          G Offline
          Gary Wheeler
          wrote on last edited by
          #4

          You're welcome. I've used the list control a fair amount, and I know some of the things that ought to be easy can be difficult to find in the MS documentation.


          Software Zen: delete this;

          T N 2 Replies Last reply
          0
          • G Gary Wheeler

            You're welcome. I've used the list control a fair amount, and I know some of the things that ought to be easy can be difficult to find in the MS documentation.


            Software Zen: delete this;

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            Gary Wheeler wrote:

            easy can be difficult to find in the MS documentation.

            Humm, sometimes!

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
            Never mind - my own stupidity is the source of every "problem" - Mixture

            cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

            F 1 Reply Last reply
            0
            • T ThatsAlok

              Gary Wheeler wrote:

              easy can be difficult to find in the MS documentation.

              Humm, sometimes!

              "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
              Never mind - my own stupidity is the source of every "problem" - Mixture

              cheers, Alok Gupta VC Forum Q&A :- I/IV Support CRY- Child Relief and You

              F Offline
              F Offline
              fantasy1215
              wrote on last edited by
              #6

              I agree too. Examples in MS documents are so poor. m_mylistctrl.SetItemState(iItem, LVIS_SELECTED, LVIS_SELECTED);

              BOOL SetItemState(
              int nItem,
              UINT nState,
              UINT nMask
              );

              But I still don't know what do these two LVIS_SELECTED mean. Should they always be the same? Anybody can tell me?

              G 1 Reply Last reply
              0
              • G Gary Wheeler

                You're welcome. I've used the list control a fair amount, and I know some of the things that ought to be easy can be difficult to find in the MS documentation.


                Software Zen: delete this;

                N Offline
                N Offline
                Nelek
                wrote on last edited by
                #7

                Not agree... I have many times found no usefull help in MSDN. It depends on what you look for. Some times the explanations are too poor and the examples vanal.

                Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)

                G 1 Reply Last reply
                0
                • F fantasy1215

                  I agree too. Examples in MS documents are so poor. m_mylistctrl.SetItemState(iItem, LVIS_SELECTED, LVIS_SELECTED);

                  BOOL SetItemState(
                  int nItem,
                  UINT nState,
                  UINT nMask
                  );

                  But I still don't know what do these two LVIS_SELECTED mean. Should they always be the same? Anybody can tell me?

                  G Offline
                  G Offline
                  Gary Wheeler
                  wrote on last edited by
                  #8

                  This approach lets you set some state bits and clear others in a single call. The nState argument contains the bits you want to set, while the nMask argument contains the bits you want to change. For example, if you call it like this:

                  m_mylistctrl.SetItemState(iItem,LVIS_FOCUSED,(LVIS_FOCUSED | LVIS_SELECTED));

                  this would set the LVIS_FOCUSED state and clear the LVIS_SELECTED state for the specified item.


                  Software Zen: delete this;

                  1 Reply Last reply
                  0
                  • N Nelek

                    Not agree... I have many times found no usefull help in MSDN. It depends on what you look for. Some times the explanations are too poor and the examples vanal.

                    Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)

                    G Offline
                    G Offline
                    Gary Wheeler
                    wrote on last edited by
                    #9

                    I didn't say MSDN was perfect. I just said that it was often more difficult to find things in it than it should be. The MSDN Library has been reorganized several times, often without any improvement in content.


                    Software Zen: delete this;

                    N 1 Reply Last reply
                    0
                    • G Gary Wheeler

                      I didn't say MSDN was perfect. I just said that it was often more difficult to find things in it than it should be. The MSDN Library has been reorganized several times, often without any improvement in content.


                      Software Zen: delete this;

                      N Offline
                      N Offline
                      Nelek
                      wrote on last edited by
                      #10

                      Sorry, then I missunderstood you. :rolleyes:

                      Greetings. -------- M.D.V. If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about? Help me to understand what I'm saying, and I'll explain it better to you ;)

                      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