diff --git a/Bin/net40/SunnyUI.Demo.exe b/Bin/net40/SunnyUI.Demo.exe index 0071735d..10f6a3c9 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 af28f702..098e130b 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 4cf92e22..d6e6958f 100644 Binary files a/Bin/net5.0-windows/SunnyUI.dll and b/Bin/net5.0-windows/SunnyUI.dll differ diff --git a/Bin/net5.0-windows/ref/SunnyUI.dll b/Bin/net5.0-windows/ref/SunnyUI.dll index 882e3cb2..6f8016e3 100644 Binary files a/Bin/net5.0-windows/ref/SunnyUI.dll and b/Bin/net5.0-windows/ref/SunnyUI.dll differ diff --git a/Bin/netcoreapp3.1/SunnyUI.dll b/Bin/netcoreapp3.1/SunnyUI.dll index 5e637bd3..8cfc037b 100644 Binary files a/Bin/netcoreapp3.1/SunnyUI.dll and b/Bin/netcoreapp3.1/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FDataGridView.Designer.cs b/SunnyUI.Demo/Controls/FDataGridView.Designer.cs index b1bd075f..3b065f08 100644 --- a/SunnyUI.Demo/Controls/FDataGridView.Designer.cs +++ b/SunnyUI.Demo/Controls/FDataGridView.Designer.cs @@ -126,8 +126,7 @@ // this.uiDataGridViewFooter1.DataGridView = this.uiDataGridView1; this.uiDataGridViewFooter1.Dock = System.Windows.Forms.DockStyle.Bottom; - this.uiDataGridViewFooter1.FillColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255))))); - this.uiDataGridViewFooter1.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiDataGridViewFooter1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.uiDataGridViewFooter1.Location = new System.Drawing.Point(0, 351); this.uiDataGridViewFooter1.MinimumSize = new System.Drawing.Size(1, 1); this.uiDataGridViewFooter1.Name = "uiDataGridViewFooter1"; diff --git a/SunnyUI.Demo/Controls/FDataGridView.Designer.resx b/SunnyUI.Demo/Controls/FDataGridView.Designer.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/SunnyUI.Demo/Controls/FDataGridView.Designer.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/SunnyUI.Demo/Controls/FDataGridView.cs b/SunnyUI.Demo/Controls/FDataGridView.cs index 94428470..9d9bdb49 100644 --- a/SunnyUI.Demo/Controls/FDataGridView.cs +++ b/SunnyUI.Demo/Controls/FDataGridView.cs @@ -8,10 +8,10 @@ namespace Sunny.UI.Demo { InitializeComponent(); - uiDataGridView1.AddColumn("Column1", "Column1").SetFixedMode(100); - uiDataGridView1.AddColumn("Column2", "Column2").SetFixedMode(100); - uiDataGridView1.AddColumn("Column3", "Column3").SetFixedMode(100); - uiDataGridView1.AddColumn("Column4", "Column4").SetFixedMode(100); + uiDataGridView1.AddColumn("Column1", "Column1").SetFixedMode(150); + uiDataGridView1.AddColumn("Column2", "Column2").SetFixedMode(150); + uiDataGridView1.AddColumn("Column3", "Column3").SetFixedMode(150); + uiDataGridView1.AddColumn("Column4", "Column4").SetFixedMode(150); uiDataGridView1.ReadOnly = true; } @@ -53,6 +53,11 @@ namespace Sunny.UI.Demo private void uiPagination1_PageChanged(object sender, object pagingSource, int pageIndex, int count) { uiDataGridView1.DataSource = pagingSource; + uiDataGridViewFooter1.Clear(); + uiDataGridViewFooter1["Column1"] = "合计:"; + uiDataGridViewFooter1["Column2"] = "Column2_" + pageIndex; + uiDataGridViewFooter1["Column3"] = "Column3_" + pageIndex; + uiDataGridViewFooter1["Column4"] = "Column4_" + pageIndex; } } } \ No newline at end of file diff --git a/SunnyUI.Demo/SunnyUI.Demo.csproj b/SunnyUI.Demo/SunnyUI.Demo.csproj index f3836e64..3c216373 100644 --- a/SunnyUI.Demo/SunnyUI.Demo.csproj +++ b/SunnyUI.Demo/SunnyUI.Demo.csproj @@ -359,6 +359,9 @@ FContextMenuStrip.cs + + FDataGridView.Designer.cs + FDataGridView.cs diff --git a/SunnyUI/Controls/UIDataGridViewFooter.cs b/SunnyUI/Controls/UIDataGridViewFooter.cs index de98d840..a34b38e0 100644 --- a/SunnyUI/Controls/UIDataGridViewFooter.cs +++ b/SunnyUI/Controls/UIDataGridViewFooter.cs @@ -37,6 +37,9 @@ namespace Sunny.UI Height = 29; RadiusSides = UICornerRadiusSides.None; RectSides = ToolStripStatusLabelBorderSides.None; + + foreColor = UIFontColor.Primary; + fillColor = UIColor.LightBlue; } private UIDataGridView dgv; @@ -113,13 +116,13 @@ namespace Sunny.UI if (str.IsNullOrEmpty()) continue; SizeF sf = g.MeasureString(str, Font); - if (rect.Left == 0 && rect.Width < column.Width) + if (rect.Left == minleft && rect.Width < column.Width) { - g.DrawString(str, Font, Color.White, rect.Width - column.Width + (column.Width - sf.Width) / 2.0f, (Height - sf.Height) / 2.0f); + g.DrawString(str, Font, ForeColor, rect.Width - column.Width + (column.Width - sf.Width) / 2.0f, (Height - sf.Height) / 2.0f); } else { - g.DrawString(str, Font, Color.White, rect.Left + (column.Width - sf.Width) / 2.0f, (Height - sf.Height) / 2.0f); + g.DrawString(str, Font, ForeColor, rect.Left + (column.Width - sf.Width) / 2.0f, (Height - sf.Height) / 2.0f); } } } @@ -130,6 +133,7 @@ namespace Sunny.UI base.SetStyleColor(uiColor); if (uiColor.IsCustom()) return; + foreColor = UIFontColor.Primary; fillColor = uiColor.PlainColor; Invalidate(); @@ -139,7 +143,7 @@ namespace Sunny.UI /// 填充颜色,当值为背景色或透明色或空值则不填充 /// [Description("填充颜色"), Category("SunnyUI")] - [DefaultValue(typeof(Color), "80, 160, 255")] + [DefaultValue(typeof(Color), "235, 243, 255")] public Color FillColor { get => fillColor; @@ -161,7 +165,7 @@ namespace Sunny.UI /// 字体颜色 /// [Description("字体颜色"), Category("SunnyUI")] - [DefaultValue(typeof(Color), "White")] + [DefaultValue(typeof(Color), "48, 48, 48")] public override Color ForeColor { get => foreColor;