Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
Unit2.cpp
Package: c++builder6编程实例.ZIP [view]
Upload User: lulishicai
Upload Date: 2010-03-01
Package Size: 13202k
Code Size: 2k
Category:
Delphi-C++Builder
Development Platform:
C++ Builder
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "Unit2.h"
- #include "Unit1.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm2 *Form2;
- //---------------------------------------------------------------------------
- __fastcall TForm2::TForm2(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm2::FormCreate(TObject *Sender)
- {
- int i;
- int j;
- //定义变量
- Form2->StringGrid1->ColCount=Form1->VtChart1->ColumnCount+1;
- Form2->StringGrid1->RowCount=Form1->VtChart1->RowCount+1;
- //设置表格的大小
- for (i=0;i<=Form1->VtChart1->ColumnCount;i++)
- {
- Form2->StringGrid1->Cells[i][0]=IntToStr(i);
- }
- for (j=0;j<=Form1->VtChart1->RowCount;j++)
- {
- Form2->StringGrid1->Cells[0][j]=IntToStr(j);
- }
- //设置表格的标题
- for (i=1;i<=Form1->VtChart1->ColumnCount;i++)
- {
- for (j=1;j<=Form1->VtChart1->RowCount;j++)
- {
- Form1->VtChart1->Column=i;
- Form1->VtChart1->Row=j;
- Form2->StringGrid1->Cells[i][j]=Form1->VtChart1->Data;
- //初始化表格中的数据
- }
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm2::Button1Click(TObject *Sender)
- {
- int i;
- int j;
- //变量定义
- for (i=1;i<=Form1->VtChart1->ColumnCount;i++)
- {
- for (j=1;j<=Form1->VtChart1->RowCount;j++)
- {
- Form1->VtChart1->Column=i;
- Form1->VtChart1->Row=j;
- Form1->VtChart1->Data=Form2->StringGrid1->Cells[i][j];
- //以表格中的数据填充图表
- }
- }
- Form1->Show();
- Form2->Hide();
- //显示主窗体
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm2::Button2Click(TObject *Sender)
- {
- Form1->Show();
- Form2->Hide();
- //显示主窗体
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm2::FormClose(TObject *Sender, TCloseAction &Action)
- {
- Form1->Show();
- //显示主窗体
- }
- //---------------------------------------------------------------------------