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 link "CGAUGES"
  8. #pragma resource "*.dfm"
  9. TForm1 *Form1;
  10. //---------------------------------------------------------------------------
  11. __fastcall TForm1::TForm1(TComponent* Owner)
  12.         : TForm(Owner)
  13. {
  14. }
  15. //---------------------------------------------------------------------------
  16. void __fastcall TForm1::PBarOpen(int nn)
  17. {
  18.   CGauge1->MaxValue=nn;
  19.   CGauge1->Progress=0;
  20.   CGauge1->Visible=True;
  21. }
  22. //---------------------------------------------------------------------------
  23. void __fastcall TForm1::PBarGo(void)
  24. {
  25.   CGauge1->Progress=CGauge1->Progress+1;
  26. }
  27. //---------------------------------------------------------------------------
  28. void __fastcall TForm1::PBarClose(void)
  29. {
  30.   CGauge1->Visible=False;
  31. }
  32. //---------------------------------------------------------------------------
  33. void __fastcall TForm1::Button1Click(TObject *Sender)
  34. {
  35.   int ii;
  36.   PBarOpen(8000);
  37.   for(ii=0;ii<8000;ii++)
  38.   {
  39.     PBarGo();
  40.   }
  41.   PBarClose();
  42. }
  43. //---------------------------------------------------------------------------