diff --git a/SunnyUI/Controls/UIDataGridView.cs b/SunnyUI/Controls/UIDataGridView.cs index 8145275a..26dddc3c 100644 --- a/SunnyUI/Controls/UIDataGridView.cs +++ b/SunnyUI/Controls/UIDataGridView.cs @@ -38,6 +38,7 @@ * 2022-06-11: V3.1.9 隐藏 RowHeight, 用 SetRowHeight() 代替,或设置原生属性: * AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None * RowTemplate.Height 设置为高度 + * 2022-06-22: V3.2.0 删除 ShowRect、ShowGridLine、RowHeight三个属性 ******************************************************************************/ using System; @@ -209,20 +210,6 @@ namespace Sunny.UI } } - //[Description("行高"), Category("SunnyUI")] - //[DefaultValue(23)] - [Browsable(false)] - [Obsolete("RowHeight 已过时,请用 SetRowHeight() 代替。", false)] - public int RowHeight { get; set; } - //{ - // get => RowTemplate.Height; - // set - // { - // AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None; - // RowTemplate.Height = Math.Max(23, value); - // } - //} - public void SetRowHeight(int height) { AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.None; @@ -590,41 +577,6 @@ namespace Sunny.UI [Description("获取或设置包含有关控件的数据的对象字符串"), Category("SunnyUI")] public string TagString { get; set; } - /// - /// 是否显示边框 - /// - //[Description("是否显示边框"), Category("SunnyUI")] - //[DefaultValue(true)] - [Browsable(false)] - [Obsolete("ShowRect 已过时,用原生属性:BorderStyle = BorderStyle.FixedSingle 代替。")] - public bool ShowRect { get; set; } - //{ - // get => BorderStyle == BorderStyle.FixedSingle; - // set - // { - // BorderStyle = value ? BorderStyle.FixedSingle : BorderStyle.None; - // Invalidate(); - // } - //} - - /// - /// 是否显示表格线 - /// - //[Description("是否显示表格线"), Category("SunnyUI")] - //[DefaultValue(true)] - //[Browsable(false)] - [Obsolete("ShowGridLine 已过时,用原生属性:CellBorderStyle = DataGridViewCellBorderStyle.Single 代替。")] - public bool ShowGridLine { get; set; } - //{ - // get => CellBorderStyle == DataGridViewCellBorderStyle.Single; - // set - // { - // if (value && CellBorderStyle != DataGridViewCellBorderStyle.Single) - // CellBorderStyle = DataGridViewCellBorderStyle.Single; - // VBar.ShowLeftLine = CellBorderStyle == DataGridViewCellBorderStyle.Single; - // } - //} - protected override void OnCellBorderStyleChanged(EventArgs e) { base.OnCellBorderStyleChanged(e); diff --git a/SunnyUI/Controls/UIEdit.cs b/SunnyUI/Controls/UIEdit.cs index 64b61b9b..61d90396 100644 --- a/SunnyUI/Controls/UIEdit.cs +++ b/SunnyUI/Controls/UIEdit.cs @@ -46,7 +46,6 @@ namespace Sunny.UI base.ForeColor = UIFontColor.Primary; Width = 150; base.MaxLength = 32767; - JoinEvents(true); } [Browsable(false), DefaultValue(false)] @@ -76,8 +75,6 @@ namespace Sunny.UI } } - private Boolean waterMarkTextEnabled; - private Color _waterMarkColor = Color.Gray; public Color WaterMarkColor { @@ -89,58 +86,6 @@ namespace Sunny.UI } } - protected override void OnCreateControl() - { - base.OnCreateControl(); - WaterMark_Toggle(null, null); - } - - protected override void OnPaint(PaintEventArgs e) - { - if (waterMarkTextEnabled) - { - e.Graphics.FillRectangle(BackColor, Bounds); - e.Graphics.DrawString(Watermark, Font, WaterMarkColor, new PointF(0.0F, 0.0F)); - } - - base.OnPaint(e); - } - - private void JoinEvents(Boolean join) - { - if (join) - { - TextChanged += WaterMark_Toggle; - LostFocus += WaterMark_Toggle; - GotFocus += WaterMark_Toggle; - MouseDown += WaterMark_Toggle; - } - } - - private void WaterMark_Toggle(object sender, EventArgs args) - { - if (Text.Length <= 0) - EnableWaterMark(); - else - DisableWaterMark(); - } - - private void EnableWaterMark() - { - //Enable OnPaint event handler - SetStyle(ControlStyles.UserPaint, Watermark.IsValid()); - waterMarkTextEnabled = Watermark.IsValid(); - //OnPaint right now - Refresh(); - } - - private void DisableWaterMark() - { - //Disable OnPaint event handler - waterMarkTextEnabled = false; - SetStyle(ControlStyles.UserPaint, false); - } - protected override void OnKeyDown(KeyEventArgs e) { if (!Multiline)