Please note that you are using .NET in a C++ program. Although not evil by itself, you are making this a lot harder than it has to be. C++/CLI (using .NET from C++) was made for exceptional cases where you require exactly this functionality and are willing to take all it's drawbacks. If you need a UI for simple learning programs, the console if absolutely sufficient and if it's not, there are a lot of native GUI libraries (MFC comes with VS for example). Using C++/CLI while you are still learning C++ is going to be extremly difficult without providing any additional benefit.