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. Keeping row selected

Keeping row selected

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
9 Posts 3 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.
  • F Offline
    F Offline
    FISH786
    wrote on last edited by
    #1

    Hello, I have 2 control lists with the following Extended Style: m_List.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER|LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS ); m_Group.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER| LVS_SHOWSELALWAYS |LVS_EX_FULLROWSELECT); I am having a problem in keeping the row highlighted when I lose focus from either of the control list. What have I set wrong or what could I be doing wrong? Thanks a million.

    D S 2 Replies Last reply
    0
    • F FISH786

      Hello, I have 2 control lists with the following Extended Style: m_List.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER|LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS ); m_Group.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER| LVS_SHOWSELALWAYS |LVS_EX_FULLROWSELECT); I am having a problem in keeping the row highlighted when I lose focus from either of the control list. What have I set wrong or what could I be doing wrong? Thanks a million.

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

      FISH786 wrote:

      m_List.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER|LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS );

      Some of those are not extended styles.

      "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

      "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

      F 1 Reply Last reply
      0
      • D David Crow

        FISH786 wrote:

        m_List.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER|LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS );

        Some of those are not extended styles.

        "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

        "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

        F Offline
        F Offline
        FISH786
        wrote on last edited by
        #3

        I guess the question is how do I keep the row selected? or do I have to set the background color just before I lose focus in order to accomplish what I need? thanks.

        D 1 Reply Last reply
        0
        • F FISH786

          I guess the question is how do I keep the row selected? or do I have to set the background color just before I lose focus in order to accomplish what I need? thanks.

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

          FISH786 wrote:

          I guess the question is how do I keep the row selected?

          By setting the LVS_SHOWSELALWAYS style (at design time).

          "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

          "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

          F 1 Reply Last reply
          0
          • D David Crow

            FISH786 wrote:

            I guess the question is how do I keep the row selected?

            By setting the LVS_SHOWSELALWAYS style (at design time).

            "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

            "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

            F Offline
            F Offline
            FISH786
            wrote on last edited by
            #5

            I guess I am doing something wrong..Cause I have the property set as true. Not sure what else to change.. Short of setting the backgroud color of the row. I have tried everything I could think of. Any other suggetion or can you think of anything I could be doing wrong? Thanks a million.

            D 1 Reply Last reply
            0
            • F FISH786

              I guess I am doing something wrong..Cause I have the property set as true. Not sure what else to change.. Short of setting the backgroud color of the row. I have tried everything I could think of. Any other suggetion or can you think of anything I could be doing wrong? Thanks a million.

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

              I tried this and the selected item in the list control remained selected, albeit in a different color, when the list control lost focus.

              "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

              "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

              F 1 Reply Last reply
              0
              • D David Crow

                I tried this and the selected item in the list control remained selected, albeit in a different color, when the list control lost focus.

                "Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                F Offline
                F Offline
                FISH786
                wrote on last edited by
                #7

                ok...I will try it again...thanks a million

                1 Reply Last reply
                0
                • F FISH786

                  Hello, I have 2 control lists with the following Extended Style: m_List.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER|LVS_EX_FULLROWSELECT | LVS_SHOWSELALWAYS ); m_Group.SetExtendedStyle(LVS_REPORT | LVS_OWNERDRAWFIXED| WS_BORDER| LVS_SHOWSELALWAYS |LVS_EX_FULLROWSELECT); I am having a problem in keeping the row highlighted when I lose focus from either of the control list. What have I set wrong or what could I be doing wrong? Thanks a million.

                  S Offline
                  S Offline
                  Stuart Dootson
                  wrote on last edited by
                  #8

                  The row stays selected and is highlighted - but the highlighting changes colour when the control loses focus - I don't believe there's nything you can do about that without making the control owner-draw.

                  Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                  F 1 Reply Last reply
                  0
                  • S Stuart Dootson

                    The row stays selected and is highlighted - but the highlighting changes colour when the control loses focus - I don't believe there's nything you can do about that without making the control owner-draw.

                    Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

                    F Offline
                    F Offline
                    FISH786
                    wrote on last edited by
                    #9

                    I was trying to avoid using custom draw.. When I look at the control very closly yes the row is still selected but the color is a very light color. I can barely notice it as been highlighted. Thanks a million for replying.

                    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