|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: May 2002
Città: udine
Messaggi: 546
|
[Visual C++ .NET]
Come mai non mi visualizza la tabella?
Codice:
// File di progetto principale per i progetti applicazioni VC++
// generati tramite una creazione guidata applicazione.
#include "stdafx.h"
#using <mscorlib.dll>
#using <System.dll>
#using <System.Data.dll>
#using <System.Windows.Forms.dll>
#using <System.Drawing.dll>
#using <System.Xml.dll>
#include <tchar.h>
using namespace System;
using namespace System::ComponentModel; //necessario quando si usano i form
using namespace System::Windows::Forms;
using namespace System::Drawing;
using namespace System::Data;
__gc public class FoglioTipoExcel : public Form
{
private:
System::ComponentModel::Container __gc *components;
DataGrid __gc *myGrid;
Button __gc *button1;
Button __gc *button2;
DataSet __gc *mySet;
public:
FoglioTipoExcel()
{
Inizializza();
}
void Inizializza()
{
// creazionde del form e dei suoi controlli
this->components = new System::ComponentModel::Container();
this->button1 = new System::Windows::Forms::Button();
this->button2 = new System::Windows::Forms::Button();
this->myGrid = new DataGrid();
// proprità del form
this->Text = S"Prova cipi";
this->Size = System::Drawing::Size(550, 450);
this->AutoScroll = true;
// proprietà della griglia myGrid
myGrid->Location = System::Drawing::Point (24,50);
myGrid->Size = System::Drawing::Size(1500, 1200);
myGrid->CaptionText = S"Griglia di prova";
// proprietà di button1
button1->Location = System::Drawing::Point (24,16);
button1->Size = System::Drawing::Size (120,24);
button1->Text = S"Accetta";
//button1->Click += new System::EventHandler(this,&FoglioTipoExcel::button1_Click);
// proprietà di button2
button2->Location = System::Drawing::Point (150,16);
button2->Size = System::Drawing::Size (120,24);
button2->Text = S"Annulla";
//button2->Click += new System::EventHandler(this,&FoglioTipoExcel::button2_Click);
// aggiunge nel form griglia, pulsanti ecc.
this->Controls->Add(button1);
this->Controls->Add(button2);
this->Controls->Add(myGrid);
}
private:
void SetUp()
{
CreaDataSet();
//Sets the DataSource and DataMember properties at run time.
myGrid->SetDataBinding(mySet,S"Customers");
};
void CreaDataSet()
{
//Create a dataset
mySet = new DataSet(S"mioDataSet");
//Create a DataTable
DataTable __gc *tTabSet = new DataTable(S"Tabella");
// Create four columns, and add them to the table.
DataColumn __gc *cID_Pen = new DataColumn();
DataColumn __gc *cID_Sym = new DataColumn();
DataColumn __gc *cNumleft = new DataColumn();
DataColumn __gc *cNumright = new DataColumn();
cID_Pen->ColumnName = S"Stringa";
cID_Pen->DataType = System::Type::GetType(S"System.String");
cID_Pen->AutoIncrement = true;
cID_Pen->AutoIncrementSeed = 1;
cID_Pen->AutoIncrementStep = 1;
cID_Sym->ColumnName = S"Symbol";
cID_Sym->DataType = System::Type::GetType(S"System.String");
cID_Sym->AutoIncrement = true;
cID_Sym->AutoIncrementSeed = 1;
cID_Sym->AutoIncrementStep = 1;
tTabSet->Columns->Add(cID_Pen);
tTabSet->Columns->Add(cID_Sym);
tTabSet->Columns->Add(cNumleft);
tTabSet->Columns->Add(cNumright);
cNumleft->ColumnName = S"Limite sx";
cNumleft->DataType = System::Type::GetType(S"System.Double");
cNumright->ColumnName = S"Limite dx";
cNumright->DataType = System::Type::GetType(S"System.Double");
// Add the tables to the DataSet.
mySet->Tables->Add(tTabSet);
/* Populate the table. Create need a DataRow variable. */
DataRow __gc *nuovaRiga;
nuovaRiga = tTabSet->NewRow();
tTabSet->Rows->Add(nuovaRiga);
};
};
// Punto di ingresso dell'applicazione
int _tmain(void)
{
// TODO: sostituire il codice di esempio che segue con codice personalizzato.
Console::WriteLine(S"Esempio costruzione tabella");
// Crea una tabella
Application::Run(new FoglioTipoExcel());
return 0;
}
|
|
|
|
|
|
#2 | |
|
Senior Member
Iscritto dal: May 2002
Città: udine
Messaggi: 546
|
Re: [Visual C++ .NET]
Quote:
Maledetto copia-incolla!!!!!!!!! |
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 22:09.



















