Hello.cpp
上传用户:lulishicai
上传日期:2010-03-01
资源大小:13202k
文件大小:1k
源码类别:

Delphi/CppBuilder

开发平台:

C++ Builder

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "Hello.h"
  5. //---------------------------------------------------------------------------
  6. #pragma package(smart_init)
  7. #pragma resource "*.dfm"
  8. TForm1 *Form1;
  9. //---------------------------------------------------------------------------
  10. __fastcall TForm1::TForm1(TComponent* Owner)
  11.         : TForm(Owner)
  12. {
  13. }
  14. //---------------------------------------------------------------------------
  15. void __fastcall TForm1::FormCreate(TObject *Sender)
  16. {
  17. Form1->Memo1->Clear();
  18. //清除文本框
  19. Form1->Memo1->Lines->Text="单击下面的OK按钮,您将会看到......";
  20. //设置Memo控件中的文本内容
  21. }
  22. //---------------------------------------------------------------------------
  23. void __fastcall TForm1::Button1Click(TObject *Sender)
  24. {
  25. ShowMessage("Hello World!");
  26. //显示一个"Hello World!"对话框
  27. }
  28. //---------------------------------------------------------------------------
  29. void __fastcall TForm1::Button2Click(TObject *Sender)
  30. {
  31. Application->Terminate();
  32. //程序运行结束
  33. }
  34. //---------------------------------------------------------------------------