Results 1 to 5 of 5

Thread: DataGridView Cell Editing Question

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2024
    Posts
    5

    DataGridView Cell Editing Question

    Hello Everyone;

    I have been able to set up and format my grid to my liking. However when I have the contents of a cell highlighted, it is always displayed with a blue background. I am wondering if this is controlled by Windows as I cannot find a way to change it. The selection fore color and selection background color work as I programmed those colors.

    Before shot

    Name:  Before.jpg
Views: 202
Size:  4.8 KB

    After Shot

    Name:  After.jpg
Views: 196
Size:  4.6 KB

    Sorry, here is a larger shot
    Large Pic:

    Name:  After_Large.jpg
Views: 195
Size:  21.9 KB

    Many thanks for reading.
    Last edited by ProgrammerJF; Dec 3rd, 2024 at 12:17 PM.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,083

    Re: DataGridView Cell Editing Question

    That's doesn't look like selection fore color and selection background color that you've set. It appears you've set the Style.BackGroundColor and the Style.ForeGroundColor.
    To assist you with that we'll need to see your code...

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2024
    Posts
    5

    Re: DataGridView Cell Editing Question

    Thanks, I discovered it is under the Windows registry; HKEY_CURRENT_USER\Control Panel\Colors, Sub Key Hilight. I changed the value there, rebooted and it is changed.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,083

    Re: DataGridView Cell Editing Question

    Quote Originally Posted by ProgrammerJF View Post
    Thanks, I discovered it is under the Windows registry; HKEY_CURRENT_USER\Control Panel\Colors, Sub Key Hilight. I changed the value there, rebooted and it is changed.
    That’s a system wide change, which will only work on your computer. If you intend to distribute your app. it won’t be changed on any other computer…

  5. #5

    Thread Starter
    New Member
    Join Date
    Dec 2024
    Posts
    5

    Re: DataGridView Cell Editing Question

    Quote Originally Posted by .paul. View Post
    That’s a system wide change, which will only work on your computer. If you intend to distribute your app. it won’t be changed on any other computer…
    Yes. I was confirming that windows controls that. You are correct, I would not want my user to have to reboot and all of that. I am able to change that color with a SetSysColors Function inside my program.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width