Closed mikel3361 closed 2 years ago
Instead of changing backcolor as in SemiTransparent Selection i changed to draw a transparent brush over cells...
Why "cell.InheritedStyle.SelectionBackColor" points to my default Palette Office365Blue instead of the current selected Palette. PaletteMode in Forms set to Global, Palette declared in Module with events. Changes are shown in Form, but property returns Palette Color from default. My transparent Box has wrong color, Header is in Style from current Palette. Any help how to get the right propery from inherited Class are welcome.
As Workaround i use now RowHeader.SelecteBackColor and it use the color i want. Added a additional option property for a differnt color if i want change it.
I inherited KryptonDataGridView and include my helper functionality insde the events. Would be great if this will be included in the future. Have translated my inherited class to c# so you can look deeper into it. References should have cleanup - increased during convert.
New properties: bool HideSelection bool AlphaBlendSelection double AlphaBlendFactor (any decimal for 0 to 1 - 1 equals 100% alpha and no transparency, default is 0,25) bool ShowRowHeaderNumbers
Edit: Have to Override OnCellPainting - some Column Types have it own Focus Highlight on CellEnter - 2022-08-10
Code: `using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Text; using System.Threading.Tasks; using Microsoft.VisualBasic; using System.Drawing; using System.Windows.Forms; using System.ComponentModel; using Krypton.Toolkit;
public partial class KryptonDataGridViewEx : KryptonDataGridView { private bool _showRowHeaderNumbers = false; private bool _hideSelection = false; private bool _alphaBlendSelection = false; private double _alphaBlendFactor = "0,25"; private int _RowHeadersWidth = RowHeadersWidth;
} `