diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index a3c875a2..97270019 100644 Binary files a/Bin/net40/SunnyUI.Demo.exe and b/Bin/net40/SunnyUI.Demo.exe differ diff --git a/Bin/net40/SunnyUI.dll b/Bin/net40/SunnyUI.dll index 936d8d3a..e7458369 100644 Binary files a/Bin/net40/SunnyUI.dll and b/Bin/net40/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/SunnyUI.dll b/Bin/net5.0-windows/SunnyUI.dll index 428cfb9b..bb7ec6c2 100644 Binary files a/Bin/net5.0-windows/SunnyUI.dll and b/Bin/net5.0-windows/SunnyUI.dll differ diff --git a/Bin/netcoreapp3.1/SunnyUI.dll b/Bin/netcoreapp3.1/SunnyUI.dll index ad00b2ba..0d7bc811 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI/Controls/UIDataGridView.cs b/SunnyUI/Controls/UIDataGridView.cs index ee4f92a9..f2f9ff81 100644 --- a/SunnyUI/Controls/UIDataGridView.cs +++ b/SunnyUI/Controls/UIDataGridView.cs @@ -70,6 +70,12 @@ namespace Sunny.UI ColumnHeadersDefaultCellStyle.ForeColor = UIColor.White; ColumnHeadersDefaultCellStyle.WrapMode = DataGridViewTriState.True; + //行头部颜色 + RowHeadersDefaultCellStyle.BackColor = UIColor.LightBlue; + RowHeadersDefaultCellStyle.ForeColor = UIFontColor.Primary; + RowHeadersDefaultCellStyle.SelectionBackColor = UIColor.Blue; + RowHeadersDefaultCellStyle.SelectionForeColor = Color.White; + //标题行行高,与OnColumnAdded事件配合 ColumnHeadersHeight = 32; @@ -88,6 +94,29 @@ namespace Sunny.UI HorizontalScrollBar.VisibleChanged += HorizontalScrollBar_VisibleChanged; } + /* + private bool showRowIndex; + + [Description("显示行号"), Category("SunnyUI")] + [DefaultValue(false)] + public bool ShowRowIndex + { + get => showRowIndex; + set + { + showRowIndex = value; + if (value) RowHeadersVisible = true; + Invalidate(); + } + } + + protected override void OnRowStateChanged(int rowIndex, DataGridViewRowStateChangedEventArgs e) + { + base.OnRowStateChanged(rowIndex, e); + if (ShowRowIndex) e.Row.HeaderCell.Value = (e.Row.Index + 1).ToString(); + } + */ + private void HorizontalScrollBar_VisibleChanged(object sender, EventArgs e) { SetScrollInfo(); @@ -384,8 +413,9 @@ namespace Sunny.UI //行头部颜色 RowHeadersDefaultCellStyle.BackColor = uiColor.PlainColor; - RowHeadersDefaultCellStyle.ForeColor = uiColor.TitleForeColor; - RowHeadersDefaultCellStyle.SelectionBackColor = uiColor.TitleColor; + RowHeadersDefaultCellStyle.ForeColor = UIFontColor.Primary; + RowHeadersDefaultCellStyle.SelectionBackColor = uiColor.RectColor; + RowHeadersDefaultCellStyle.SelectionForeColor = Color.White; //数据行选中颜色 DefaultCellStyle.SelectionBackColor = uiColor.GridSelectedColor; diff --git a/SunnyUI/SunnyUI.csproj b/SunnyUI/SunnyUI.csproj index 268a1e11..4a284c94 100644 --- a/SunnyUI/SunnyUI.csproj +++ b/SunnyUI/SunnyUI.csproj @@ -36,6 +36,7 @@ +