Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.50 KB | None | 0 0
  1. unit Unit1;
  2.  
  3. interface
  4.  
  5. uses
  6. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  7. Dialogs, StdCtrls, ExtCtrls;
  8.  
  9. type
  10.   TForm1 = class(TForm)
  11.     Edit1: TEdit;
  12.     Edit2: TEdit;
  13.     Memo1: TMemo;
  14.     Label1: TLabel;
  15.     Label2: TLabel;
  16.     Label3: TLabel;
  17.     Button1: TButton;
  18.     Button2: TButton;
  19.     Image1: TImage;
  20.     procedure Button1Click(Sender: TObject);
  21.     procedure Button2Click(Sender: TObject);
  22.     procedure Memo1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  23.  
  24. private
  25. { Private declarations }
  26. public
  27. { Public declarations }
  28. end;
  29.  
  30. var
  31. Form1: TForm1;
  32.  
  33. implementation
  34.  
  35. {$R *.dfm}
  36.  
  37. //Botão que une as palavras
  38. procedure TForm1.Button1Click(Sender: TObject);
  39. var
  40. Linha: string;
  41. Posicao: byte;
  42. begin
  43. for Posicao:=0 to Memo1.Lines.Capacity do
  44. begin
  45. Linha := Self.Memo1.Lines.Strings[Posicao];
  46. Linha := Edit1.Text+Linha+Edit2.Text;
  47. Self.Memo1.Lines.Strings[Posicao]:=Linha;
  48. end;
  49. end;
  50.  
  51. //Botão que seleciona e copia para o clipboard
  52. procedure TForm1.Button2Click(Sender: TObject);
  53. begin
  54. Memo1.SelectAll;
  55. Memo1.CopyToClipboard;
  56. Memo1.SelStart:=0;
  57. Memo1.SelLength:=Length(Memo1.Text);
  58. end;
  59.  
  60. //Funcionar CTRL+A que seleciona tudo no memo (frescurebs)
  61. procedure TForm1.Memo1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
  62. begin
  63. if (Key=Ord('A')) and (ssCtrl in Shift) then
  64. begin
  65. TMemo(Sender).SelectAll;
  66. Key:=0;
  67. end;
  68. end;
  69.  
  70. //Coded by SuPrEm3 (Daniel/Nerd)
  71. //Conhecimento não é crime, compartilhe!
  72.  
  73. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement