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#
  4. How can I Allow focus for multiple controls?

How can I Allow focus for multiple controls?

Scheduled Pinned Locked Moved C#
question
4 Posts 2 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.
  • E Offline
    E Offline
    eyalbi007
    wrote on last edited by
    #1

    Hi all, My main application form occupies two listview controls. Whenever I select a line in one of the listviews, I lose the selection of the selected line in the 2nd listview. The solution of setting the 'HideSelection' property to 'true' is not good enough since I want the selected lines in both listviews to be colored blue, not grey. Any suggestions? Thanks a lot, Eyal.

    P 1 Reply Last reply
    0
    • E eyalbi007

      Hi all, My main application form occupies two listview controls. Whenever I select a line in one of the listviews, I lose the selection of the selected line in the 2nd listview. The solution of setting the 'HideSelection' property to 'true' is not good enough since I want the selected lines in both listviews to be colored blue, not grey. Any suggestions? Thanks a lot, Eyal.

      P Offline
      P Offline
      pmarfleet
      wrote on last edited by
      #2

      Write your own code to change the colour of the whole row when it is selected.

      Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

      E 1 Reply Last reply
      0
      • P pmarfleet

        Write your own code to change the colour of the whole row when it is selected.

        Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

        E Offline
        E Offline
        eyalbi007
        wrote on last edited by
        #3

        OK, I guess you mean I should select custom color for the line when the control is not in focus (in case 'HideSelection' property iquals 'true'). How do I do that? Thanks!

        P 1 Reply Last reply
        0
        • E eyalbi007

          OK, I guess you mean I should select custom color for the line when the control is not in focus (in case 'HideSelection' property iquals 'true'). How do I do that? Thanks!

          P Offline
          P Offline
          pmarfleet
          wrote on last edited by
          #4

          Get a reference to the item(s) that are selected from the SelectedItems property of the control. Then set the BackColor property of each item to an appropriate colour.

          Paul Marfleet "No, his mind is not for rent To any God or government" Tom Sawyer - Rush

          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