📄 test.h
字号:
#pragma once
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
namespace test
{
/// <summary>
/// test 摘要
///
/// 警告: 如果您更改该类的名称,则将需要更改
/// 与该类所依赖的所有 .resx 文件关联的托管资源编译器工具的
/// “资源文件名”属性。 否则,
/// 设计器将不能与此窗体关联的
/// 本地化资源正确交互。
/// </summary>
public __gc class test : public System::Windows::Forms::Form
{
public:
test(void)
{
InitializeComponent();
}
protected:
void Dispose(Boolean disposing)
{
if (disposing && components)
{
components->Dispose();
}
__super::Dispose(disposing);
}
private: System::Windows::Forms::DataGrid * dataGrid1;
private: System::Windows::Forms::Button * button1;
private:
/// <summary>
/// 必需的设计器变量。
/// </summary>
System::ComponentModel::Container* components;
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
void InitializeComponent(void)
{
this->dataGrid1 = new System::Windows::Forms::DataGrid();
this->button1 = new System::Windows::Forms::Button();
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->dataGrid1))->BeginInit();
this->SuspendLayout();
//
// dataGrid1
//
this->dataGrid1->DataMember = S"";
this->dataGrid1->HeaderForeColor = System::Drawing::SystemColors::ControlText;
this->dataGrid1->Location = System::Drawing::Point(24, 48);
this->dataGrid1->Name = S"dataGrid1";
this->dataGrid1->Size = System::Drawing::Size(240, 120);
this->dataGrid1->TabIndex = 0;
//
// button1
//
this->button1->Location = System::Drawing::Point(16, 16);
this->button1->Name = S"button1";
this->button1->Size = System::Drawing::Size(64, 24);
this->button1->TabIndex = 1;
this->button1->Text = S"button1";
this->button1->Click += new System::EventHandler(this, button1_Click);
//
// test
//
this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
this->ClientSize = System::Drawing::Size(292, 266);
this->Controls->Add(this->button1);
this->Controls->Add(this->dataGrid1);
this->Name = S"test";
this->Text = S"访问XML";
(__try_cast<System::ComponentModel::ISupportInitialize * >(this->dataGrid1))->EndInit();
this->ResumeLayout(false);
}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{
DataSet* ds=new System::Data::DataSet("xml");
String* path;
path="C:\第54例\XML\myXML.xsd";
ds->ReadXmlSchema(path);
dataGrid1->DataSource = ds;
}
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -