--------------------------------------------------- Form1.h 内 #pragma once #include "Obj.h" namespace MakeObj { using namespace System; using namespace System::ComponentModel; using namespace System::Collections; --中略-- this->Text = L"Form1"; this->ResumeLayout(false); } #pragma endregion private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) { Obj::Make(this,this); } }; } --------------------------------------------------- Obj.h (クラスのヘッダーファイル)内 #pragma once ref class Obj { public: Obj(void); static void Make(System::Windows::Forms::Control^); }; --------------------------------------------------- Obj.cpp (クラスの実装部分)内 #include "StdAfx.h" #include "Obj.h" Obj::Obj(void) { } void Obj::Make(System::Windows::Forms::Control^ frm) { System::Windows::Forms::Button^ button2; button2 = gcnew System::Windows::Forms::Button(); //ボタンインスタンス化 frm->Controls->Add(button2); } ---------------------------------------------------