Use ReadOnlyRichTextBox in about form

This commit is contained in:
Jaex 2021-12-28 01:47:18 +03:00
parent cb3942fdf9
commit 3a452de20f
4 changed files with 50 additions and 6 deletions

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
#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);
}
}
}
}

View file

@ -113,6 +113,9 @@
<Compile Include="Controls\ObjectListView.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ReadOnlyRichTextBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ToolStripRoundedEdgeRenderer.cs" />
<Compile Include="Controls\DarkColorTable.cs" />
<Compile Include="Controls\HotkeySelectionButton.cs">

View file

@ -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;

View file

@ -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