* UIRichTextBox: 修改滚动条颜色跟随主题

This commit is contained in:
Sunny 2024-07-20 21:48:24 +08:00
parent bac0f32fd2
commit abab088e0b
2 changed files with 57 additions and 56 deletions

View File

@ -24,6 +24,7 @@
* 2022-11-03: V3.2.6 * 2022-11-03: V3.2.6
* 2023-11-13: V3.5.2 * 2023-11-13: V3.5.2
* 2023-12-25: V3.6.2 Text的属性编辑器 * 2023-12-25: V3.6.2 Text的属性编辑器
* 2024-07-20: V3.6.8
******************************************************************************/ ******************************************************************************/
using System; using System;
@ -506,40 +507,40 @@ namespace Sunny.UI
private void InitializeComponent() private void InitializeComponent()
{ {
this.edit = new System.Windows.Forms.RichTextBox(); edit = new RichTextBox();
this.bar = new Sunny.UI.UIScrollBar(); bar = new UIScrollBar();
this.SuspendLayout(); SuspendLayout();
// //
// edit // edit
// //
this.edit.BorderStyle = System.Windows.Forms.BorderStyle.None; edit.BorderStyle = BorderStyle.None;
this.edit.Dock = System.Windows.Forms.DockStyle.Fill; edit.Dock = DockStyle.Fill;
this.edit.Location = new System.Drawing.Point(2, 2); edit.Location = new Point(2, 2);
this.edit.Name = "edit"; edit.Name = "edit";
this.edit.Size = new System.Drawing.Size(266, 176); edit.Size = new Size(266, 176);
this.edit.TabIndex = 0; edit.TabIndex = 0;
this.edit.Text = ""; edit.Text = "";
// //
// bar // bar
// //
this.bar.Font = new System.Drawing.Font("宋体", 12F); bar.Font = new Font("宋体", 12F);
this.bar.Location = new System.Drawing.Point(247, 4); bar.Location = new Point(247, 4);
this.bar.Name = "bar"; bar.MinimumSize = new Size(1, 1);
this.bar.Size = new System.Drawing.Size(19, 173); bar.Name = "bar";
this.bar.Style = Sunny.UI.UIStyle.Custom; bar.Size = new Size(19, 173);
this.bar.TabIndex = 2; bar.TabIndex = 2;
this.bar.Text = "uiScrollBar1"; bar.Text = "uiScrollBar1";
// //
// UIRichTextBox // UIRichTextBox
// //
this.Controls.Add(this.bar); Controls.Add(bar);
this.Controls.Add(this.edit); Controls.Add(edit);
this.FillColor = System.Drawing.Color.White; FillColor = Color.White;
this.Name = "UIRichTextBox"; Name = "UIRichTextBox";
this.Padding = new System.Windows.Forms.Padding(2); Padding = new Padding(2);
this.FontChanged += new System.EventHandler(this.UIRichTextBox_FontChanged); FontChanged += UIRichTextBox_FontChanged;
this.SizeChanged += new System.EventHandler(this.UIRichTextBox_SizeChanged); SizeChanged += UIRichTextBox_SizeChanged;
this.ResumeLayout(false); ResumeLayout(false);
} }
private void UIRichTextBox_SizeChanged(object sender, EventArgs e) private void UIRichTextBox_SizeChanged(object sender, EventArgs e)