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.

相关阅读 >>

Delphi xe 控件字体加粗变色居中等

Delphi 动态内存查找法

Delphi 日期字符串转换日期格式

Delphi webbrowser中模拟连接点击(非鼠标模拟)

Delphi idtcp上传文件

Delphi 简单实习窗体靠边隐藏

Delphi获取exe文件版本信息的函数

Delphi:取得浏览器地址,网址(支持ie,firefox)

Delphi showmodal与show的区别

Delphi 动态创建一个ipedit控件

更多相关阅读请进入《Delphi》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...