Change the hover colour of DataGridViewComboBoxCell in winforms (Always shows blue color)

cool77bin 1 Reputation point
2020-08-26T05:30:45.15+00:00

I have a datagridview which contains DataGridViewComboBoxCell, these cells are added to the grid dynamically through code.

When I hover through the cells it always shows blue color (hover color), I need to set the hover color based on application theme (need to set color other than blue), How it can be set?

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,331 questions
No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,471 Reputation points
    2020-08-27T09:21:08.687+00:00

    Hi cool77bin,
    After doing some research, it is hard to set the hover colorof DataGridViewComboBoxCell directly.
    And I have a suggestion you can refer to.
    You can try to customize combobox and add it to datagridview, which has the same effect as DataGridViewComboBoxCell.
    This thread may help you.
    Then you can get windows system color.
    In winforms, you can use System.Drawing.SystemColors.
    More details you can refer to this thread.
    Best Regards,
    Daniel Zhang

    No comments