EditParam.pas 799 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. unit EditParam;
  2. interface
  3. uses
  4. Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5. Dialogs, StdCtrls;
  6. type
  7. TfrmEditParam = class(TForm)
  8. btnCancel: TButton;
  9. btnOK: TButton;
  10. Label1: TLabel;
  11. Label2: TLabel;
  12. txtName: TEdit;
  13. txtComment: TEdit;
  14. procedure btnOKClick(Sender: TObject);
  15. private
  16. { Private declarations }
  17. public
  18. { Public declarations }
  19. end;
  20. var
  21. frmEditParam: TfrmEditParam;
  22. implementation
  23. {$R *.dfm}
  24. procedure TfrmEditParam.btnOKClick(Sender: TObject);
  25. begin
  26. ModalResult := mrNone;
  27. if txtName.Text = '' then
  28. begin
  29. Windows.MessageBox(Self.Handle, 'You must enter a name for the parameter.', 'Header Builder', MB_OK+MB_ICONERROR);
  30. txtName.SetFocus;
  31. end
  32. else
  33. ModalResult := mrOk;
  34. end;
  35. end.