listview item loses background color after I change selection

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ari

    listview item loses background color after I change selection

    I have recently upgraded from vb.net 2002 to 2005, and have
    encountered the following problem.

    I have a listview with say a dozen items. Following a user action I
    programmaticall y update the background colour of the currently
    selected item to red. Lets say in this case it was the 3rd row.

    The 3rd row is still the current item, so its still got a blue
    background. Now in the past if I scrolled down or clicked on another
    row, I would see the 3rd row with a red background, but now I don't -
    its white. If I resize the window (which resizes the listview) I
    suddenly see the 3rd row with a red background, but if I select it,
    and then something else, then it goes back to being white until I
    resize again, when it again is red.
  • Armin Zingler

    #2
    Re: listview item loses background color after I change selection

    "ari" <unikoski@yahoo .comschrieb
    I have recently upgraded from vb.net 2002 to 2005, and have
    encountered the following problem.
    >
    I have a listview with say a dozen items. Following a user action I
    programmaticall y update the background colour of the currently
    selected item to red. Lets say in this case it was the 3rd row.
    >
    The 3rd row is still the current item, so its still got a blue
    background. Now in the past if I scrolled down or clicked on another
    row, I would see the 3rd row with a red background, but now I don't
    - its white. If I resize the window (which resizes the listview) I
    suddenly see the 3rd row with a red background, but if I select it,
    and then something else, then it goes back to being white until I
    resize again, when it again is red.
    I don't see which problem you have with the VB.Net language. The Treeview is
    a .Net Framework component shared by all Framework clients, so the right
    place to ask is a Framework group, like
    m.p.dotnet.fram ework.windowsfo rms.controls.


    Armin

    Comment

    • Lloyd Sheen

      #3
      Re: listview item loses background color after I change selection


      "ari" <unikoski@yahoo .comwrote in message
      news:9c86ea36-f4d8-48ed-99e7-330fd9d99b40@s1 g2000prg.google groups.com...
      >I have recently upgraded from vb.net 2002 to 2005, and have
      encountered the following problem.
      >
      I have a listview with say a dozen items. Following a user action I
      programmaticall y update the background colour of the currently
      selected item to red. Lets say in this case it was the 3rd row.
      >
      The 3rd row is still the current item, so its still got a blue
      background. Now in the past if I scrolled down or clicked on another
      row, I would see the 3rd row with a red background, but now I don't -
      its white. If I resize the window (which resizes the listview) I
      suddenly see the 3rd row with a red background, but if I select it,
      and then something else, then it goes back to being white until I
      resize again, when it again is red.
      What you are seeing is the selected row color (when you select it).

      When it is not selected it will have the background colour you assigned.

      Selected colour is set by the user in themes for windows.

      LS

      Comment

      • ari

        #4
        Re: listview item loses background color after I change selection

        On Nov 19, 8:31 pm, "Lloyd Sheen" <a...@b.cwrot e:
        "ari" <uniko...@yahoo .comwrote in message
        >
        news:9c86ea36-f4d8-48ed-99e7-330fd9d99b40@s1 g2000prg.google groups.com...
        >
        I have recently upgraded from vb.net 2002 to 2005, and have
        encountered the following problem.
        >
        I have a listview with say a dozen items. Following a user action I
        programmaticall y update the background colour  of the currently
        selected item to red. Lets say in this case it was the 3rd row.
        >
        The 3rd row is still the current item, so its still got a blue
        background. Now in the past if I scrolled down or clicked on another
        row, I would see the 3rd row with a red background, but now I don't -
        its white. If I resize the window (which resizes the listview) I
        suddenly see the 3rd row with a red background, but if I select it,
        and then something else, then it goes back to being white until I
        resize again, when it again is red.
        >
        What you are seeing is the selected row color (when you select it).
        >
        When it is not selected it will have the background colour you assigned.
        >
        Selected colour is set by the user in themes for windows.
        >
        LS
        No - the problem is that when it is not selected I am NOT seeing the
        background I assigned, I am only seeing white. Only when I resize the
        window does it apply the color I assigned.

        Comment

        • Lloyd Sheen

          #5
          Re: listview item loses background color after I change selection


          "ari" <unikoski@yahoo .comwrote in message
          news:64199442-2abe-4e41-94ec-53486f30b031@v1 3g2000yqm.googl egroups.com...
          On Nov 19, 8:31 pm, "Lloyd Sheen" <a...@b.cwrot e:
          "ari" <uniko...@yahoo .comwrote in message
          >
          news:9c86ea36-f4d8-48ed-99e7-330fd9d99b40@s1 g2000prg.google groups.com...
          >
          I have recently upgraded from vb.net 2002 to 2005, and have
          encountered the following problem.
          >
          I have a listview with say a dozen items. Following a user action I
          programmaticall y update the background colour of the currently
          selected item to red. Lets say in this case it was the 3rd row.
          >
          The 3rd row is still the current item, so its still got a blue
          background. Now in the past if I scrolled down or clicked on another
          row, I would see the 3rd row with a red background, but now I don't -
          its white. If I resize the window (which resizes the listview) I
          suddenly see the 3rd row with a red background, but if I select it,
          and then something else, then it goes back to being white until I
          resize again, when it again is red.
          >
          What you are seeing is the selected row color (when you select it).
          >
          When it is not selected it will have the background colour you assigned.
          >
          Selected colour is set by the user in themes for windows.
          >
          LS
          No - the problem is that when it is not selected I am NOT seeing the
          background I assigned, I am only seeing white. Only when I resize the
          window does it apply the color I assigned.


          Ok do you have the HideSelection of the control set to True, if so set it to
          False
          LS

          Comment

          Working...