CHomby
2022-06-09T10:27:54Z
Hello,
Is it possible to extend the "IGButtonColumnManager" class (extra sample for iGrid.Net) so that the background color and foreground color can be changed to desired colors?
Many thanks in advance!
CHomby
Igor/10Tec
2022-06-10T15:40:35Z
That helper class is based on the ButtonRenderer  class from .NET Framework. We call its DrawButton  method to draw the push button inside iGrid cells. The functionality of the ButtonRenderer class is a wrapper for the Windows API calls that render push buttons using the current visual style of the OS. This may depend on the version of Windows, but in the general case you can't change the button image because it comes as a bitmap from the system styles.

To implement what you need, the whole drawing approach must be changed. Obviously, we need to rewrite the drawing of push buttons with the hover and pressed effect from scratch. But this will complicate the sample a lot and we will also lose the system look of the cell buttons.
abraXus
2022-09-29T14:27:51Z
I have come across the same issue. Disappointing.

If there is no fix planned, is there a work-around at least?

The only thing I can think of to try and do is not use the ButtonColumnManager and instead use an Ellipsis button in specific cells, assuming I can get it to fit the cell width.

I welcome any suggestions.
Igor/10Tec
2022-09-29T15:37:24Z
Unfortunately, no fix is planned because of the nature of Windows API drawing approach used to render OS-styled buttons.

An alternative way could be usage of methods like ControlPaint.DrawBorder3D  to render a push button with a custom background color, but in this case we will have the 'good old' 3D buttons (not good :)

See also this question on Stackoverflow:

How do I draw a button with a nonstandard BackColor?