delphi TXT 指定行复制器  
官方Delphi 学习QQ群: 682628230(三千人)
频道

delphi TXT 指定行复制器


unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,clipbrd,strutils;
type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    Edit1: TEdit;
    Edit2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Button2: TButton;
    Edit3: TEdit;
    Label3: TLabel;
    Label4: TLabel;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var  i:Integer;
    clip: TClipboard;
    t1:tstringlist;
begin
      t1:=tstringlist.create;
        clip := TClipboard.Create; {建立}
      for  i:=StrToInt(edit1.text)-1 to StrToInt(edit2.text)-1 do
      begin
            t1.add(memo1.lines[i]);
      end;
            clip.AsText := t1.text;  {把窗体标题放入剪切板}
        clip.Free;                {释放}
        t1.Free;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
          memo1.Lines.loadfromfile(Edit3.text);
end;
end.

推荐分享
图文皆来源于网络,内容仅做公益性分享,版权归原作者所有,如有侵权请告知删除!
 

Copyright © 2014 DelphiW.com 开发 源码 文档 技巧 All Rights Reserved
晋ICP备14006235号-8 晋公网安备 14108102000087号

执行时间: 0.062747001647949 seconds