/*★ MessageBox とキャプションを表示する 前田 稔 ★*/ #using #using using namespace System; using namespace System::Windows::Forms; //フォームを作成するクラス ref class FormClass { private: Form^ form; public: //Constructor FormClass() { form = gcnew Form(); } //Form のキャプションを設定 Form^ SetText() { form->Text = "C++/CLI のフォームです♪"; return form; } }; //★ main() 関数 int main() { MessageBox::Show("C++/CLI で Form を表示します","caption"); FormClass MyForm; Form^ form = MyForm.SetText(); Application::Run(form); return 0; }