* UIRichTextBox: 增加滚动条的颜色设置
This commit is contained in:
parent
ad600f6459
commit
53dff9d743
Binary file not shown.
Binary file not shown.
9
SunnyUI.Demo/Controls/FTextBox.Designer.cs
generated
9
SunnyUI.Demo/Controls/FTextBox.Designer.cs
generated
@ -54,6 +54,7 @@ namespace Sunny.UI.Demo
|
|||||||
//
|
//
|
||||||
// uiTextBox6
|
// uiTextBox6
|
||||||
//
|
//
|
||||||
|
this.uiTextBox6.ButtonSymbolOffset = new System.Drawing.Point(0, 1);
|
||||||
this.uiTextBox6.ButtonWidth = 100;
|
this.uiTextBox6.ButtonWidth = 100;
|
||||||
this.uiTextBox6.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.uiTextBox6.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.uiTextBox6.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
this.uiTextBox6.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||||
@ -76,6 +77,7 @@ namespace Sunny.UI.Demo
|
|||||||
//
|
//
|
||||||
// uiTextBox5
|
// uiTextBox5
|
||||||
//
|
//
|
||||||
|
this.uiTextBox5.ButtonSymbolOffset = new System.Drawing.Point(0, 1);
|
||||||
this.uiTextBox5.ButtonWidth = 100;
|
this.uiTextBox5.ButtonWidth = 100;
|
||||||
this.uiTextBox5.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.uiTextBox5.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.uiTextBox5.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
this.uiTextBox5.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||||
@ -98,6 +100,7 @@ namespace Sunny.UI.Demo
|
|||||||
//
|
//
|
||||||
// uiTextBox4
|
// uiTextBox4
|
||||||
//
|
//
|
||||||
|
this.uiTextBox4.ButtonSymbolOffset = new System.Drawing.Point(0, 1);
|
||||||
this.uiTextBox4.ButtonWidth = 100;
|
this.uiTextBox4.ButtonWidth = 100;
|
||||||
this.uiTextBox4.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.uiTextBox4.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.uiTextBox4.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
this.uiTextBox4.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||||
@ -113,6 +116,7 @@ namespace Sunny.UI.Demo
|
|||||||
this.uiTextBox4.Name = "uiTextBox4";
|
this.uiTextBox4.Name = "uiTextBox4";
|
||||||
this.uiTextBox4.Padding = new System.Windows.Forms.Padding(5);
|
this.uiTextBox4.Padding = new System.Windows.Forms.Padding(5);
|
||||||
this.uiTextBox4.RectReadOnlyColor = System.Drawing.Color.FromArgb(((int)(((byte)(173)))), ((int)(((byte)(178)))), ((int)(((byte)(181)))));
|
this.uiTextBox4.RectReadOnlyColor = System.Drawing.Color.FromArgb(((int)(((byte)(173)))), ((int)(((byte)(178)))), ((int)(((byte)(181)))));
|
||||||
|
this.uiTextBox4.ShowScrollBar = true;
|
||||||
this.uiTextBox4.Size = new System.Drawing.Size(308, 226);
|
this.uiTextBox4.Size = new System.Drawing.Size(308, 226);
|
||||||
this.uiTextBox4.TabIndex = 5;
|
this.uiTextBox4.TabIndex = 5;
|
||||||
this.uiTextBox4.Text = "Blog: https://www.cnblogs.com/yhuse\r\nGitee: https://gitee.com/yhuse/SunnyUI\r\nGitH" +
|
this.uiTextBox4.Text = "Blog: https://www.cnblogs.com/yhuse\r\nGitee: https://gitee.com/yhuse/SunnyUI\r\nGitH" +
|
||||||
@ -148,6 +152,7 @@ namespace Sunny.UI.Demo
|
|||||||
// uiRichTextBox1
|
// uiRichTextBox1
|
||||||
//
|
//
|
||||||
this.uiRichTextBox1.AutoWordSelection = true;
|
this.uiRichTextBox1.AutoWordSelection = true;
|
||||||
|
this.uiRichTextBox1.BackColor = System.Drawing.Color.White;
|
||||||
this.uiRichTextBox1.FillColor = System.Drawing.Color.White;
|
this.uiRichTextBox1.FillColor = System.Drawing.Color.White;
|
||||||
this.uiRichTextBox1.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
this.uiRichTextBox1.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||||
this.uiRichTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
this.uiRichTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F);
|
||||||
@ -228,6 +233,7 @@ namespace Sunny.UI.Demo
|
|||||||
//
|
//
|
||||||
// uiTextBox3
|
// uiTextBox3
|
||||||
//
|
//
|
||||||
|
this.uiTextBox3.ButtonSymbolOffset = new System.Drawing.Point(0, 1);
|
||||||
this.uiTextBox3.ButtonWidth = 100;
|
this.uiTextBox3.ButtonWidth = 100;
|
||||||
this.uiTextBox3.CanEmpty = true;
|
this.uiTextBox3.CanEmpty = true;
|
||||||
this.uiTextBox3.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.uiTextBox3.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
@ -262,6 +268,7 @@ namespace Sunny.UI.Demo
|
|||||||
//
|
//
|
||||||
// uiTextBox2
|
// uiTextBox2
|
||||||
//
|
//
|
||||||
|
this.uiTextBox2.ButtonSymbolOffset = new System.Drawing.Point(0, 1);
|
||||||
this.uiTextBox2.ButtonWidth = 100;
|
this.uiTextBox2.ButtonWidth = 100;
|
||||||
this.uiTextBox2.CanEmpty = true;
|
this.uiTextBox2.CanEmpty = true;
|
||||||
this.uiTextBox2.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.uiTextBox2.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
@ -322,7 +329,7 @@ namespace Sunny.UI.Demo
|
|||||||
//
|
//
|
||||||
// uiTextBox1
|
// uiTextBox1
|
||||||
//
|
//
|
||||||
this.uiTextBox1.ButtonSymbol = 361761;
|
this.uiTextBox1.ButtonSymbolOffset = new System.Drawing.Point(0, 1);
|
||||||
this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
|
this.uiTextBox1.Cursor = System.Windows.Forms.Cursors.IBeam;
|
||||||
this.uiTextBox1.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
this.uiTextBox1.FillColor2 = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(243)))), ((int)(((byte)(255)))));
|
||||||
this.uiTextBox1.FillReadOnlyColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244)))));
|
this.uiTextBox1.FillReadOnlyColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244)))));
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
* 2021-05-25: V3.0.4 支持可改背景色
|
* 2021-05-25: V3.0.4 支持可改背景色
|
||||||
* 2021-07-29: V3.0.5 修改滚动条没有文字时自动隐藏
|
* 2021-07-29: V3.0.5 修改滚动条没有文字时自动隐藏
|
||||||
* 2022-02-23: V3.1.1 增加了一些原生的属性和事件
|
* 2022-02-23: V3.1.1 增加了一些原生的属性和事件
|
||||||
|
* 2022-03-14: V3.1.1 增加滚动条的颜色设置
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
@ -174,7 +175,7 @@ namespace Sunny.UI
|
|||||||
|
|
||||||
public RichTextBox RichTextBox => edit;
|
public RichTextBox RichTextBox => edit;
|
||||||
|
|
||||||
public override Color BackColor { get => edit.BackColor; set { edit.BackColor = base.BackColor = value; } }
|
//public override Color BackColor { get => edit.BackColor; set { edit.BackColor = base.BackColor = value; } }
|
||||||
|
|
||||||
protected override void OnContextMenuStripChanged(EventArgs e)
|
protected override void OnContextMenuStripChanged(EventArgs e)
|
||||||
{
|
{
|
||||||
@ -263,20 +264,62 @@ namespace Sunny.UI
|
|||||||
public override void SetStyleColor(UIBaseStyle uiColor)
|
public override void SetStyleColor(UIBaseStyle uiColor)
|
||||||
{
|
{
|
||||||
base.SetStyleColor(uiColor);
|
base.SetStyleColor(uiColor);
|
||||||
edit.BackColor = fillColor = Color.White;
|
fillColor = uiColor.EditorBackColor;
|
||||||
edit.ForeColor = foreColor = UIFontColor.Primary;
|
foreColor = UIFontColor.Primary;
|
||||||
|
edit.BackColor = GetFillColor();
|
||||||
|
edit.ForeColor = GetForeColor();
|
||||||
|
|
||||||
if (bar != null)
|
if (bar != null)
|
||||||
{
|
{
|
||||||
bar.ForeColor = uiColor.PrimaryColor;
|
bar.ForeColor = uiColor.PrimaryColor;
|
||||||
bar.HoverColor = uiColor.ButtonFillHoverColor;
|
bar.HoverColor = uiColor.ButtonFillHoverColor;
|
||||||
bar.PressColor = uiColor.ButtonFillPressColor;
|
bar.PressColor = uiColor.ButtonFillPressColor;
|
||||||
bar.FillColor = Color.White;
|
bar.FillColor = fillColor;
|
||||||
|
scrollBarColor = uiColor.PrimaryColor;
|
||||||
|
scrollBarBackColor = fillColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Color scrollBarColor = Color.FromArgb(80, 160, 255);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 填充颜色,当值为背景色或透明色或空值则不填充
|
||||||
|
/// </summary>
|
||||||
|
[Description("填充颜色"), Category("SunnyUI")]
|
||||||
|
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||||
|
public Color ScrollBarColor
|
||||||
|
{
|
||||||
|
get => scrollBarColor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
scrollBarColor = value;
|
||||||
|
bar.HoverColor = bar.PressColor = bar.ForeColor = value;
|
||||||
|
_style = UIStyle.Custom;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color scrollBarBackColor = Color.White;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 填充颜色,当值为背景色或透明色或空值则不填充
|
||||||
|
/// </summary>
|
||||||
|
[Description("填充颜色"), Category("SunnyUI")]
|
||||||
|
[DefaultValue(typeof(Color), "White")]
|
||||||
|
public Color ScrollBarBackColor
|
||||||
|
{
|
||||||
|
get => scrollBarBackColor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
scrollBarBackColor = value;
|
||||||
|
bar.FillColor = value;
|
||||||
|
_style = UIStyle.Custom;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void AfterSetForeColor(Color color)
|
protected override void AfterSetForeColor(Color color)
|
||||||
{
|
{
|
||||||
base.AfterSetForeColor(color);
|
base.AfterSetForeColor(color);
|
||||||
@ -287,6 +330,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
base.AfterSetFillColor(color);
|
base.AfterSetFillColor(color);
|
||||||
edit.BackColor = color;
|
edit.BackColor = color;
|
||||||
|
bar.FillColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void EditOnKeyPress(object sender, KeyPressEventArgs e)
|
private void EditOnKeyPress(object sender, KeyPressEventArgs e)
|
||||||
|
@ -776,6 +776,8 @@ namespace Sunny.UI
|
|||||||
bar.HoverColor = uiColor.ButtonFillHoverColor;
|
bar.HoverColor = uiColor.ButtonFillHoverColor;
|
||||||
bar.PressColor = uiColor.ButtonFillPressColor;
|
bar.PressColor = uiColor.ButtonFillPressColor;
|
||||||
bar.FillColor = fillColor;
|
bar.FillColor = fillColor;
|
||||||
|
scrollBarColor = uiColor.PrimaryColor;
|
||||||
|
scrollBarBackColor = fillColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (btn != null)
|
if (btn != null)
|
||||||
@ -796,6 +798,43 @@ namespace Sunny.UI
|
|||||||
Invalidate();
|
Invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Color scrollBarColor = Color.FromArgb(80, 160, 255);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 填充颜色,当值为背景色或透明色或空值则不填充
|
||||||
|
/// </summary>
|
||||||
|
[Description("填充颜色"), Category("SunnyUI")]
|
||||||
|
[DefaultValue(typeof(Color), "80, 160, 255")]
|
||||||
|
public Color ScrollBarColor
|
||||||
|
{
|
||||||
|
get => scrollBarColor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
scrollBarColor = value;
|
||||||
|
bar.HoverColor = bar.PressColor = bar.ForeColor = value;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color scrollBarBackColor = Color.White;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 填充颜色,当值为背景色或透明色或空值则不填充
|
||||||
|
/// </summary>
|
||||||
|
[Description("填充颜色"), Category("SunnyUI")]
|
||||||
|
[DefaultValue(typeof(Color), "White")]
|
||||||
|
public Color ScrollBarBackColor
|
||||||
|
{
|
||||||
|
get => scrollBarBackColor;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
scrollBarBackColor = value;
|
||||||
|
bar.FillColor = value;
|
||||||
|
_style = UIStyle.Custom;
|
||||||
|
Invalidate();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void AfterSetForeColor(Color color)
|
protected override void AfterSetForeColor(Color color)
|
||||||
{
|
{
|
||||||
base.AfterSetForeColor(color);
|
base.AfterSetForeColor(color);
|
||||||
@ -806,6 +845,7 @@ namespace Sunny.UI
|
|||||||
{
|
{
|
||||||
base.AfterSetFillColor(color);
|
base.AfterSetFillColor(color);
|
||||||
edit.BackColor = GetFillColor();
|
edit.BackColor = GetFillColor();
|
||||||
|
bar.FillColor = color;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void AfterSetFillReadOnlyColor(Color color)
|
protected override void AfterSetFillReadOnlyColor(Color color)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user