/*____________________________________________ * * C R E A T E M S G B O X C L A S S * * CS120 C++ 2012 * Ron Kessler * Created 2/1/2014 *____________________________________________ * * * This class has overloaded constructors. When called, the compiler * matches the arguments sent from the calling code with the overloaded * signatures in my constructors. If it finds a match, it creates an instance of * this class and uses the arguments to construct a standard messagebox. */ using namespace System; using namespace System::Windows::Forms; //so we can use messagebox #pragma once ref class CreateMsgBox { public: CreateMsgBox(void) { // default constructor MessageBox::Show("You are using the default constructor of my CreateMsgBox class."); } public: CreateMsgBox(String^ msg) // constructor with one parameter { MessageBox::Show(msg); } public: CreateMsgBox(String^ msg, String^ caption) //constructor with two parameters { MessageBox::Show(msg, caption); } };