Unit19.pas
上传用户:szyozho
上传日期:2013-04-13
资源大小:3688k
文件大小:3k
源码类别:

教育系统应用

开发平台:

Delphi

  1. unit Unit19;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, Menus, StdCtrls;
  6. type
  7.   Tmadeanswerform = class(TForm)
  8.     Memo1: TMemo;
  9.     MainMenu1: TMainMenu;
  10.     N3: TMenuItem;
  11.     N26: TMenuItem;
  12.     N5: TMenuItem;
  13.     N19: TMenuItem;
  14.     N6: TMenuItem;
  15.     N21: TMenuItem;
  16.     FontDialog1: TFontDialog;
  17.     N1: TMenuItem;
  18.     N4: TMenuItem;
  19.     N7: TMenuItem;
  20.     N8: TMenuItem;
  21.     N9: TMenuItem;
  22.     N10: TMenuItem;
  23.     procedure N19Click(Sender: TObject);
  24.     procedure N24Click(Sender: TObject);
  25.     procedure N26Click(Sender: TObject);
  26.     procedure N2Click(Sender: TObject);
  27.     procedure N4Click(Sender: TObject);
  28.     procedure N7Click(Sender: TObject);
  29.     procedure N8Click(Sender: TObject);
  30.     procedure N9Click(Sender: TObject);
  31.     procedure N10Click(Sender: TObject);
  32.   private
  33.     { Private declarations }
  34.   public
  35.     { Public declarations }
  36.   end;
  37. var
  38.   madeanswerform: Tmadeanswerform;
  39.     fname:string;
  40. implementation
  41.    uses printers;
  42. {$R *.dfm}
  43. procedure Tmadeanswerform.N19Click(Sender: TObject);
  44. begin
  45. if fontdialog1.Execute then
  46. begin
  47. memo1.Font:=fontdialog1.Font;
  48. end;
  49. end;
  50. procedure Tmadeanswerform.N24Click(Sender: TObject);
  51. //var
  52. //filename:string;
  53. begin
  54. //savedialog1.Title:='保存生成后的试卷';
  55. //savedialog1.FileName:=fname;
  56. //if savedialog1.Execute then
  57.   // begin
  58.   // filename:=savedialog1.FileName;
  59.   // memo1.Lines.SaveToFile(filename+'.doc');
  60.  //  end;
  61. end;
  62. procedure Tmadeanswerform.N26Click(Sender: TObject);
  63. begin
  64.  close;
  65. end;
  66. procedure Tmadeanswerform.N2Click(Sender: TObject);
  67. //var lines :integer;
  68.  //   prntext:system.text;
  69. begin
  70. Screen.Cursor:=crHourGlass;
  71.   try
  72.     print;
  73.     ShowMessage('打印完毕');
  74.   finally
  75.     Screen.Cursor:=crDefault;
  76.   end;
  77.       {
  78.     if printdialog1.Execute then
  79.     assignprn(prntext);
  80.     rewrite(prntext);
  81.     printer.canvas.Font:=memo1.font;
  82.     for lines:=0 to memo1.Lines.Count-1 do
  83.     begin
  84.     writeln(prntext,memo1.lines[lines]);
  85.     system.Close(prntext);
  86.     end; }
  87. end;
  88. procedure Tmadeanswerform.N4Click(Sender: TObject);
  89. begin
  90. memo1.Undo;
  91. end;
  92. procedure Tmadeanswerform.N7Click(Sender: TObject);
  93. begin
  94. memo1.CutToClipboard;
  95. end;
  96. procedure Tmadeanswerform.N8Click(Sender: TObject);
  97. begin
  98. memo1.CopyToClipboard;
  99. end;
  100. procedure Tmadeanswerform.N9Click(Sender: TObject);
  101. begin
  102. Memo1.PasteFromClipboard;
  103. end;
  104. procedure Tmadeanswerform.N10Click(Sender: TObject);
  105. begin
  106. memo1.SelectAll;
  107. madeanswerform.N8.Enabled:=true;
  108. madeanswerform.N9.Enabled:=true;
  109. end;
  110. end.