欢迎来到天天文库
浏览记录
ID:41894966
大小:91.99 KB
页数:6页
时间:2019-09-04
《C#读取Excel的剪贴板》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、C#读取Excel的剪贴板1.Forml.Designer.cs,创建winform应川程序,并在forml中替添加一个button和一个richtextbox:I.namespaceWindowsFormsApplicationl2・{3.partialclassForml4.{5.Ill6.IllRequireddesignervariable.7.Ill8.privateSystem.ComponentModel.IContainercomponents=null;9.9.IllII.
2、IllCleanupanyresourcesbeingused.12.Ill13.Illtrueifmanagedresourcesshouldbedisposed;otherwise^false.14.protectedoverridevoidDispose(booldisposing)15.{16.if(disposing&&(components!=null))17.{18.comporients.Dispose();19.}20.base.Dispose(d
3、isposing);21.}22.23.#regionWindowsFormDesignergeneratedcode24.24.Ill25.IllRequiredmethodforDesignersupport・donotmodify26.Illthecontentsofthismethodwiththecodeeditor.27.IllprivatevoidInitializeComponent(){this.button]=newSystem.Windows.Forms.Button();this.^i
4、chTextBoxl=newSystem.Windows.Fonms.RichTextBox();this•SuspendLayout();////buttonl//this.buttonl.Location二newSystem.Dnawing.Point(12,12);this.buttonl.Name=buttonl11;this.buttonl.Size=newSystem.Drawing・Size(75,23);this.buttonl.Tablndex=0;this.buttonl.Text=11read11;this.buttonl.
5、UseVisualStyleBackColor=true;this.button1.Click+=newSystem.EventHandler(this・buttonl_Click);////richTextBoxl//this.richTextBoxl.Location二newSystem.Drawing.Point(12,60);this.richTextBoxl.Name=l,richTextBoxl1';this.richTextBoxl.Size=newSystem.Drawing・Size(268,201);this.richText
6、Boxl.Tabindex=1;this.richTextBoxl.Text=1111;////Forml//this.AutoScaleDimensions=newSystem.Drawing.SizeF(6F>13F);this.AutoScaleMode=System.Windows.Forms.AutoScaleMode.Font;this.ClientSize=newSystem.Drawing.Size(292,273);this•Controls•Add(this•richTextBoxl);this•Controls.Add(th
7、is•buttonl);this.Name=,lFormlf,;this.Text=,lForml,';this•ResumeLayout(false);64.}65.65.#endregion67.64.privateSystem.Windows.Forms-Buttonbutton];65.privateSystem.Windows.Forms.RichTextBoxrichTextBoxl;66.}67.}1.给button加上click事件1.usingSystem;2.usingSystem.Collections.Generic;3.
8、usingSystem.ComporientModel;4.usingSystem.Data;5.usingSystem.Drawing
此文档下载收益归作者所有