增加复制黏贴按钮

This commit is contained in:
FalconFly 2024-07-22 17:13:55 +08:00
parent 3dc4df4e5b
commit 8ea15b2ab7
6 changed files with 272 additions and 2 deletions

View File

@ -13,4 +13,19 @@
<PackageReference Include="SqlSugarCore" Version="5.1.4.162" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>

View File

@ -0,0 +1,63 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码由工具生成。
// 运行时版本:4.0.30319.42000
//
// 对此文件的更改可能会导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// </auto-generated>
//------------------------------------------------------------------------------
namespace CalendarNotepad.Properties {
using System;
/// <summary>
/// 一个强类型的资源类,用于查找本地化的字符串等。
/// </summary>
// 此类是由 StronglyTypedResourceBuilder
// 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
// 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
// (以 /str 作为命令选项),或重新生成 VS 项目。
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// 返回此类使用的缓存的 ResourceManager 实例。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("CalendarNotepad.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// 重写当前线程的 CurrentUICulture 属性,对
/// 使用此强类型资源类的所有资源查找执行重写。
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
}
}

View File

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@ -25,6 +25,7 @@
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WorkMain));
tabControl1 = new TabControl();
tpWorkManage = new TabPage();
splitContainer1 = new SplitContainer();
@ -46,6 +47,9 @@
radioButton5 = new RadioButton();
mcWorkDay = new MonthCalendar();
rtbMsg = new RichTextBox();
toolStrip1 = new ToolStrip();
tsp_Copy = new ToolStripButton();
tsb_palse = new ToolStripButton();
tabControl1.SuspendLayout();
tpWorkManage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)splitContainer1).BeginInit();
@ -57,6 +61,7 @@
flowLayoutPanel1.SuspendLayout();
gbWorkTypes.SuspendLayout();
C_WorkTypes.SuspendLayout();
toolStrip1.SuspendLayout();
SuspendLayout();
//
// tabControl1
@ -97,6 +102,7 @@
// splitContainer1.Panel2
//
splitContainer1.Panel2.Controls.Add(rtbMsg);
splitContainer1.Panel2.Controls.Add(toolStrip1);
splitContainer1.Size = new Size(681,454);
splitContainer1.SplitterDistance = 236;
splitContainer1.TabIndex = 9;
@ -289,11 +295,41 @@
//
rtbMsg.Dock = DockStyle.Fill;
rtbMsg.EnableAutoDragDrop = true;
rtbMsg.Location = new Point(0,0);
rtbMsg.Location = new Point(0,25);
rtbMsg.Name = "rtbMsg";
rtbMsg.Size = new Size(441,454);
rtbMsg.Size = new Size(441,429);
rtbMsg.TabIndex = 7;
rtbMsg.Text = "";
rtbMsg.LinkClicked += rtbMsg_LinkClicked;
//
// toolStrip1
//
toolStrip1.Items.AddRange(new ToolStripItem[] { tsp_Copy,tsb_palse });
toolStrip1.Location = new Point(0,0);
toolStrip1.Name = "toolStrip1";
toolStrip1.Size = new Size(441,25);
toolStrip1.TabIndex = 8;
toolStrip1.Text = "toolStrip1";
//
// tsp_Copy
//
tsp_Copy.DisplayStyle = ToolStripItemDisplayStyle.Text;
tsp_Copy.ImageTransparentColor = Color.Magenta;
tsp_Copy.Name = "tsp_Copy";
tsp_Copy.Size = new Size(36,22);
tsp_Copy.Text = "复制";
tsp_Copy.TextAlign = ContentAlignment.MiddleRight;
tsp_Copy.Click += tsp_Copy_Click;
//
// tsb_palse
//
tsb_palse.DisplayStyle = ToolStripItemDisplayStyle.Text;
tsb_palse.Image = (Image)resources.GetObject("tsb_palse.Image");
tsb_palse.ImageTransparentColor = Color.Magenta;
tsb_palse.Name = "tsb_palse";
tsb_palse.Size = new Size(36,22);
tsb_palse.Text = "粘贴";
tsb_palse.Click += tsb_palse_Click;
//
// WorkMain
//
@ -311,6 +347,7 @@
splitContainer1.Panel1.ResumeLayout(false);
splitContainer1.Panel1.PerformLayout();
splitContainer1.Panel2.ResumeLayout(false);
splitContainer1.Panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)splitContainer1).EndInit();
splitContainer1.ResumeLayout(false);
groupBox1.ResumeLayout(false);
@ -320,6 +357,8 @@
gbWorkTypes.ResumeLayout(false);
C_WorkTypes.ResumeLayout(false);
C_WorkTypes.PerformLayout();
toolStrip1.ResumeLayout(false);
toolStrip1.PerformLayout();
ResumeLayout(false);
}
@ -346,5 +385,8 @@
private GroupBox groupBox1;
private FlowLayoutPanel C_WorkOut;
private RadioButton radioButton9;
private ToolStrip toolStrip1;
private ToolStripButton tsp_Copy;
private ToolStripButton tsb_palse;
}
}

View File

@ -189,5 +189,22 @@ namespace CalendarNotepad
}
return "";
}
private void rtbMsg_LinkClicked(object sender,LinkClickedEventArgs e) {
try {
System.Diagnostics.Process.Start(e.LinkText);
}
catch(Exception ex) {
MessageBox.Show(ex.ToString());
}
}
private void tsp_Copy_Click(object sender,EventArgs e) {
Clipboard.SetText(this.rtbMsg.SelectedText);
}
private void tsb_palse_Click(object sender,EventArgs e) {
this.rtbMsg.AppendText(Clipboard.GetText());
}
}
}

View File

@ -117,4 +117,17 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="tsb_palse.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACRSURBVDhPY/j27dt/SjDYACcnJ7IwigEf3n8kCZNswPNb
J/+f6DYF0yA+yQac6Db5f6hWCmwIiE+mC0wIu2DS2Vf/F1x6DefjwlgNyNr34r/0wkdgTMgQDAOQNRNj
CIoBOg0rMTTDMLIhIHbriZeYBmDTiIxBGkEYxge5liQDsGGQqykyAISpZwAlmIEywMAAAAc1/Jwvt6sN
AAAAAElFTkSuQmCC
</value>
</data>
</root>