fixed #696: Label auto copy bug workaround

This commit is contained in:
Jaex 2015-05-18 09:22:40 +03:00
parent 8c6a9151f0
commit cc68931c00
4 changed files with 64 additions and 2 deletions

View file

@ -23,6 +23,7 @@
#endregion License Information (GPL v3)
using System;
using System.ComponentModel;
using System.Drawing;
using System.Drawing.Design;
@ -53,6 +54,7 @@ public override string Text
{
text = value;
Refresh();
OnTextChanged(EventArgs.Empty);
}
}
}

View file

@ -0,0 +1,57 @@
#region License Information (GPL v3)
/*
ShareX - A program that allows you to take screenshots and share any file type
Copyright © 2007-2015 ShareX Developers
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;
using System.Windows.Forms;
namespace ShareX.HelpersLib
{
public class LabelNoCopy : Label
{
private string text;
public override string Text
{
get
{
return text;
}
set
{
if (value == null)
{
value = "";
}
if (text != value)
{
text = value;
Refresh();
OnTextChanged(EventArgs.Empty);
}
}
}
}
}

View file

@ -102,6 +102,9 @@
<Compile Include="Colors\HSB.cs" />
<Compile Include="Colors\MyColor.cs" />
<Compile Include="Colors\RGBA.cs" />
<Compile Include="Controls\LabelNoCopy.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\ToolStripButtonColorAnimation.cs">
<SubType>Component</SubType>
</Compile>

View file

@ -30,7 +30,7 @@ private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(HotkeySelectionControl));
this.lblHotkeyStatus = new System.Windows.Forms.Label();
this.lblHotkeyDescription = new System.Windows.Forms.Label();
this.lblHotkeyDescription = new ShareX.HelpersLib.LabelNoCopy();
this.btnHotkey = new System.Windows.Forms.Button();
this.SuspendLayout();
//
@ -79,7 +79,7 @@ private void InitializeComponent()
#endregion
private System.Windows.Forms.Label lblHotkeyStatus;
private System.Windows.Forms.Label lblHotkeyDescription;
private ShareX.HelpersLib.LabelNoCopy lblHotkeyDescription;
private System.Windows.Forms.Button btnHotkey;
}
}