diff --git a/ShareX.HelpersLib/Controls/ReadOnlyRichTextBox.cs b/ShareX.HelpersLib/Controls/ReadOnlyRichTextBox.cs new file mode 100644 index 000000000..d2ad136b8 --- /dev/null +++ b/ShareX.HelpersLib/Controls/ReadOnlyRichTextBox.cs @@ -0,0 +1,45 @@ +#region License Information (GPL v3) + +/* + ShareX - A program that allows you to take screenshots and share any file type + Copyright (c) 2007-2021 ShareX Team + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + Optionally you can also view the license at . +*/ + +#endregion License Information (GPL v3) + +using System.Windows.Forms; + +namespace ShareX.HelpersLib +{ + public class ReadOnlyRichTextBox : RichTextBox + { + public ReadOnlyRichTextBox() + { + ReadOnly = true; + } + + protected override void WndProc(ref Message m) + { + if (m.Msg != (int)WindowsMessages.SETFOCUS) + { + base.WndProc(ref m); + } + } + } +} \ No newline at end of file diff --git a/ShareX.HelpersLib/ShareX.HelpersLib.csproj b/ShareX.HelpersLib/ShareX.HelpersLib.csproj index 8578f11ab..057fe3d02 100644 --- a/ShareX.HelpersLib/ShareX.HelpersLib.csproj +++ b/ShareX.HelpersLib/ShareX.HelpersLib.csproj @@ -113,6 +113,9 @@ Component + + Component + diff --git a/ShareX/Forms/AboutForm.Designer.cs b/ShareX/Forms/AboutForm.Designer.cs index 7ed4c48ad..2ccb7409c 100644 --- a/ShareX/Forms/AboutForm.Designer.cs +++ b/ShareX/Forms/AboutForm.Designer.cs @@ -33,7 +33,7 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutForm)); this.lblProductName = new System.Windows.Forms.Label(); - this.rtbInfo = new System.Windows.Forms.RichTextBox(); + this.rtbInfo = new HelpersLib.ReadOnlyRichTextBox(); this.pbLogo = new System.Windows.Forms.PictureBox(); this.btnClose = new System.Windows.Forms.Button(); this.btnShareXLicense = new System.Windows.Forms.Button(); @@ -134,7 +134,7 @@ private void InitializeComponent() private System.Windows.Forms.Label lblProductName; private HelpersLib.Canvas cLogo; - private System.Windows.Forms.RichTextBox rtbInfo; + private HelpersLib.ReadOnlyRichTextBox rtbInfo; private HelpersLib.UpdateCheckerLabel uclUpdate; private System.Windows.Forms.PictureBox pbLogo; private System.Windows.Forms.Button btnClose; diff --git a/ShareX/Forms/AboutForm.cs b/ShareX/Forms/AboutForm.cs index d2ad9d86a..102c5a993 100644 --- a/ShareX/Forms/AboutForm.cs +++ b/ShareX/Forms/AboutForm.cs @@ -38,12 +38,8 @@ public partial class AboutForm : Form public AboutForm() { InitializeComponent(); - lblProductName.Text = Program.Title; pbLogo.Image = ShareXResources.Logo; - - rtbInfo.AddContextMenu(); - ShareXResources.ApplyTheme(this); #if STEAM