diff --git a/Bin/SunnyUI.Demo.exe b/Bin/SunnyUI.Demo.exe index e1de759e..6bebcf11 100644 Binary files a/Bin/SunnyUI.Demo.exe and b/Bin/SunnyUI.Demo.exe differ diff --git a/Bin/SunnyUI.dll b/Bin/SunnyUI.dll index 7b45b87b..8ae43d02 100644 Binary files a/Bin/SunnyUI.dll and b/Bin/SunnyUI.dll differ diff --git a/SunnyUI.Demo/Controls/FTextBox.Designer.cs b/SunnyUI.Demo/Controls/FTextBox.Designer.cs index 2415a6d1..cb590b1b 100644 --- a/SunnyUI.Demo/Controls/FTextBox.Designer.cs +++ b/SunnyUI.Demo/Controls/FTextBox.Designer.cs @@ -43,7 +43,10 @@ this.uiLine2 = new Sunny.UI.UILine(); this.uiLine3 = new Sunny.UI.UILine(); this.uiTextBox4 = new Sunny.UI.UITextBox(); + this.uiContextMenuStrip1 = new Sunny.UI.UIContextMenuStrip(); + this.aaToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.PagePanel.SuspendLayout(); + this.uiContextMenuStrip1.SuspendLayout(); this.SuspendLayout(); // // PagePanel @@ -214,6 +217,7 @@ // uiRichTextBox1 // this.uiRichTextBox1.AutoWordSelection = true; + this.uiRichTextBox1.ContextMenuStrip = this.uiContextMenuStrip1; this.uiRichTextBox1.FillColor = System.Drawing.Color.White; this.uiRichTextBox1.Font = new System.Drawing.Font("微软雅黑", 12F); this.uiRichTextBox1.Location = new System.Drawing.Point(388, 219); @@ -269,6 +273,20 @@ "nnyUI技术交流群),请给源码项目点个Star吧!!!"; this.uiTextBox4.Watermark = "水印文字"; // + // uiContextMenuStrip1 + // + this.uiContextMenuStrip1.Font = new System.Drawing.Font("微软雅黑", 12F); + this.uiContextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.aaToolStripMenuItem}); + this.uiContextMenuStrip1.Name = "uiContextMenuStrip1"; + this.uiContextMenuStrip1.Size = new System.Drawing.Size(99, 30); + // + // aaToolStripMenuItem + // + this.aaToolStripMenuItem.Name = "aaToolStripMenuItem"; + this.aaToolStripMenuItem.Size = new System.Drawing.Size(98, 26); + this.aaToolStripMenuItem.Text = "aa"; + // // FTextBox // this.AutoScaleDimensions = new System.Drawing.SizeF(10F, 21F); @@ -277,8 +295,10 @@ this.Name = "FTextBox"; this.Symbol = 61962; this.Text = "TextBox"; + this.Controls.SetChildIndex(this.PagePanel, 0); this.PagePanel.ResumeLayout(false); this.PagePanel.PerformLayout(); + this.uiContextMenuStrip1.ResumeLayout(false); this.ResumeLayout(false); } @@ -299,5 +319,7 @@ private UITextBox uiTextBox4; private UILine uiLine3; private UILine uiLine2; + private UIContextMenuStrip uiContextMenuStrip1; + private System.Windows.Forms.ToolStripMenuItem aaToolStripMenuItem; } } \ No newline at end of file diff --git a/SunnyUI.Demo/Controls/FTextBox.resx b/SunnyUI.Demo/Controls/FTextBox.resx index 1af7de15..93ecf1d7 100644 --- a/SunnyUI.Demo/Controls/FTextBox.resx +++ b/SunnyUI.Demo/Controls/FTextBox.resx @@ -117,4 +117,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + \ No newline at end of file diff --git a/SunnyUI/Controls/UIListBox.cs b/SunnyUI/Controls/UIListBox.cs index 20b2deaf..d6c34942 100644 --- a/SunnyUI/Controls/UIListBox.cs +++ b/SunnyUI/Controls/UIListBox.cs @@ -69,6 +69,12 @@ namespace Sunny.UI timer.Start(); } + protected override void OnContextMenuStripChanged(EventArgs e) + { + base.OnContextMenuStripChanged(e); + listbox.ContextMenuStrip = ContextMenuStrip; + } + private void Listbox_MouseMove(object sender, MouseEventArgs e) { MouseMove?.Invoke(this, e); diff --git a/SunnyUI/Controls/UIRichTextBox.cs b/SunnyUI/Controls/UIRichTextBox.cs index 4d6db965..e3aa5643 100644 --- a/SunnyUI/Controls/UIRichTextBox.cs +++ b/SunnyUI/Controls/UIRichTextBox.cs @@ -46,6 +46,12 @@ namespace Sunny.UI edit.ScrollBars = RichTextBoxScrollBars.Vertical; } + protected override void OnContextMenuStripChanged(EventArgs e) + { + base.OnContextMenuStripChanged(e); + edit.ContextMenuStrip = ContextMenuStrip; + } + protected override void OnFontChanged(EventArgs e) { base.OnFontChanged(e);