Unit1.cpp
上传用户:lhxd_sz
上传日期:2014-10-02
资源大小:38814k
文件大小:1k
源码类别:

VC书籍

开发平台:

C++ Builder

  1. //---------------------------------------------------------------------------
  2. #include <vcl.h>
  3. #pragma hdrstop
  4. #include "Unit1.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. __fastcall TForm1::~TForm1()
  16. {
  17.   DeleteAll();
  18. }
  19. //---------------------------------------------------------------------------
  20. void __fastcall TForm1::DeleteAll(void)
  21. {
  22.   int ii;
  23.   for(ii=0;ii<ScrollBox1->ControlCount;ii++)
  24.   {
  25.     ScrollBox1->Controls[ii]->Free();
  26.   }
  27. }
  28. //---------------------------------------------------------------------------
  29. void __fastcall TForm1::Button5Click(TObject *Sender)
  30. {
  31.   TPanel *pn;
  32.   pn=new TPanel(ScrollBox1);
  33.   pn->Parent=ScrollBox1;
  34.   pn->Left=10;
  35.   pn->Top=10;
  36. }
  37. //---------------------------------------------------------------------------