1- シンプルな Windows フォーム アプリケーションを作成したところ、次の行が生成されました。
System::ComponentModel::Container ^components;
これは、次の形式のデストラクタにあります。
if (components)
{
delete components;
}
しかし、両方をコメントすると、まったく違いはありません。私のコードでの使用法や使用例を教えてください。
事前に感謝します。ここに完全なコードがあります..非常に単純なフォームです。私の物の描画を指定する多くの不要な行を削除しました
#pragma once
namespace PC2newversion {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
/// <summary>
/// Summary for SignUp
/// </summary>
public ref class SignUp : public System::Windows::Forms::Form
{
public:
SignUp(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~SignUp()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ label8;
protected:
private: System::Windows::Forms::TextBox^ textBox8;
private: System::Windows::Forms::TextBox^ textBox7;
private: System::Windows::Forms::Label^ label7;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::TextBox^ textBox6;
private: System::Windows::Forms::Label^ label5;
private: System::Windows::Forms::TextBox^ textBox5;
private: System::Windows::Forms::Button^ button1;
private: System::Windows::Forms::TextBox^ textBox4;
private: System::Windows::Forms::TextBox^ textBox3;
private: System::Windows::Forms::TextBox^ textBox2;
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label1;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->label8 = (gcnew System::Windows::Forms::Label());
//Deleted many unnecessary lines here
//
// SignUp
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(379, 266);
this->Controls->Add(this->label8);
this->Controls->Add(this->textBox8);
this->Controls->Add(this->textBox7);
this->Controls->Add(this->label7);
this->Controls->Add(this->label6);
this->Controls->Add(this->textBox6);
this->Controls->Add(this->label5);
this->Controls->Add(this->textBox5);
this->Controls->Add(this->button1);
this->Controls->Add(this->textBox4);
this->Controls->Add(this->textBox3);
this->Controls->Add(this->textBox2);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->label4);
this->Controls->Add(this->label3);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Name = L"SignUp";
this->Text = L"SignUp";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
};
}
2-イン
this->Controls->...
Controls は変数 (ポインターまたはハンドル) であるはずではありませんか? では、どこに宣言されているのでしょうか。