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. void __fastcall TForm1::CloseControl(int tag)
  16. {
  17.   int nn,ii;
  18.   nn=ControlCount;
  19.   for(ii=0;ii<nn;ii++)
  20.   {
  21.     if(Controls[ii]->Tag==tag)Controls[ii]->Visible=False;
  22.   }
  23. }
  24. //---------------------------------------------------------------------------
  25. void __fastcall TForm1::TestButton1Click(TObject *Sender)
  26. {
  27.   CloseControl(1);
  28. }
  29. //---------------------------------------------------------------------------
  30. void __fastcall TForm1::TestButton2Click(TObject *Sender)
  31. {
  32.   CloseControl(2);
  33. }
  34. //---------------------------------------------------------------------------
  35. void __fastcall TForm1::TestButton3Click(TObject *Sender)
  36. {
  37.   CloseControl(3);
  38. }
  39. //---------------------------------------------------------------------------