Unit1.cpp
上传用户:lulishicai
上传日期:2010-03-01
资源大小:13202k
文件大小:2k
源码类别:
Delphi/CppBuilder
开发平台:
C++ Builder
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit1.h"
- #include "Unit2.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormCreate(TObject *Sender)
- {
- Form1->VtChart1->RandomFill;
- //随机填充图表
- Form1->ComboBox1->Items->Add("VtChChartType3dBar");
- Form1->ComboBox1->Items->Add("VtChChartType2dBar");
- Form1->ComboBox1->Items->Add("VtChChartType3dLine");
- Form1->ComboBox1->Items->Add("VtChChartType2dLine");
- Form1->ComboBox1->Items->Add("VtChChartType3dArea");
- Form1->ComboBox1->Items->Add("VtChChartType2dArea");
- Form1->ComboBox1->Items->Add("VtChChartType3dStep");
- Form1->ComboBox1->Items->Add("VtChChartType2dStep");
- Form1->ComboBox1->Items->Add("VtChChartType3dCombination");
- Form1->ComboBox1->Items->Add("VtChChartType2dCombination");
- Form1->ComboBox1->Items->Add("VtChChartType3dHorizontalBar");
- Form1->ComboBox1->Items->Add("VtChChartType2dHorizontalBar");
- Form1->ComboBox1->Items->Add("VtChChartType3dClusteredBar");
- Form1->ComboBox1->Items->Add("VtChChartType3dPie");
- Form1->ComboBox1->Items->Add("VtChChartType2dPie");
- //填充列表项
- Form1->VtChart1->ChartType=0;
- //设置图表类型
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- Form1->Hide();
- //隐藏主窗体
- Form1->VtChart1->UseWizard();
- //显示向导程序
- Form1->Show();
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button2Click(TObject *Sender)
- {
- Form1->Hide();
- Form2->Show();
- //显示数据赋值窗体
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button3Click(TObject *Sender)
- {
- Form1->VtChart1->RandomFill;
- //随机填充图表
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::ComboBox1Click(TObject *Sender)
- {
- Form1->VtChart1->ChartType=Form1->ComboBox1->ItemIndex;
- //对图表使用当前选中的图表类型
- }
- //---------------------------------------------------------------------------