From 00bdb927eac501c1e4e6f6aef60189b2e99798ee Mon Sep 17 00:00:00 2001 From: Jaex Date: Fri, 14 Apr 2023 23:20:12 +0300 Subject: [PATCH] Add context menu --- ShareX.HelpersLib/Forms/OutputBox.Designer.cs | 1 + ShareX.HelpersLib/Forms/OutputBox.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ShareX.HelpersLib/Forms/OutputBox.Designer.cs b/ShareX.HelpersLib/Forms/OutputBox.Designer.cs index 3da18c8c1..b3c35a563 100644 --- a/ShareX.HelpersLib/Forms/OutputBox.Designer.cs +++ b/ShareX.HelpersLib/Forms/OutputBox.Designer.cs @@ -39,6 +39,7 @@ private void InitializeComponent() this.rtbText.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.rtbText.Location = new System.Drawing.Point(8, 8); this.rtbText.Name = "rtbText"; + this.rtbText.ReadOnly = true; this.rtbText.Size = new System.Drawing.Size(968, 745); this.rtbText.TabIndex = 1; this.rtbText.Text = ""; diff --git a/ShareX.HelpersLib/Forms/OutputBox.cs b/ShareX.HelpersLib/Forms/OutputBox.cs index 1bfb539f2..dcfb2771b 100644 --- a/ShareX.HelpersLib/Forms/OutputBox.cs +++ b/ShareX.HelpersLib/Forms/OutputBox.cs @@ -35,6 +35,7 @@ public partial class OutputBox : Form private OutputBox(string text, string title, bool scrollToEnd = false) { InitializeComponent(); + rtbText.AddContextMenu(); ShareXResources.ApplyTheme(this); Text = "ShareX - " + title; @@ -60,6 +61,10 @@ private void OutputBox_Shown(object sender, EventArgs e) { NativeMethods.SendMessage(rtbText.Handle, (int)WindowsMessages.VSCROLL, (int)ScrollBarCommands.SB_BOTTOM, 0); } + else + { + NativeMethods.SendMessage(rtbText.Handle, (int)WindowsMessages.VSCROLL, (int)ScrollBarCommands.SB_TOP, 0); + } } private void rtbText_KeyUp(object sender, KeyEventArgs e)