資源描述:
《C#讀取Excel的剪貼板》由會員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、C#讀取Excel的剪貼板1.Forml.Designer.cs,創(chuàng)建winform應(yīng)川程序,并在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