CheckerMemoFrm.pas 932 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. unit CheckerMemoFrm;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, StdCtrls, ExtCtrls;
  6. type
  7. TCheckerMemoForm = class(TForm)
  8. lblMemo: TLabel;
  9. mmMemo: TMemo;
  10. btnPost: TButton;
  11. btnCancel: TButton;
  12. lblHint: TLabel;
  13. private
  14. function GetMemo: string;
  15. { Private declarations }
  16. public
  17. { Public declarations }
  18. property Memo: string read GetMemo;
  19. // 0 ÉóºË²»Í¨¹ý£»1 ÉóºËͨ¹ý
  20. procedure Init(AHint: string; AType: Integer);
  21. end;
  22. implementation
  23. {$R *.dfm}
  24. { TCheckerMemoForm }
  25. function TCheckerMemoForm.GetMemo: string;
  26. begin
  27. Result := mmMemo.Text;
  28. end;
  29. procedure TCheckerMemoForm.Init(AHint: string; AType: Integer);
  30. begin
  31. if AType = 0 then
  32. begin
  33. lblHint.Font.Color := clRed;
  34. end
  35. else if AType = 1 then
  36. begin
  37. lblHint.Font.Color := clGreen;
  38. end;
  39. lblHint.Caption := AHint;
  40. lblHint.Update;
  41. end;
  42. end.