I am a complete beginner with Windows Forms, and Microsoft's help file is not in the least bit helpful.
I am using Visual Studio 2005, and I am trying to make a simple app where you click a button, and it sets a label's text to whatever the user has entered into a textbox. However, I always get errors when running it.
1. When I try:
1 2 3
char* text;
text = textBox1->Text;
label1->Text = text;
Was it the Windows Forms Application wizard under CLR or a different one? The reason I ask is that my copy of Visual Studio 2005 produces code like this when I run the Windows Forms Application wizard.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include "stdafx.h"
#include "Form1.h"
usingnamespace test;
[STAThreadAttribute]
int main(array<System::String ^> ^args)
{
// Enabling Windows XP visual effects before any controls are created
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
// Create the main window and run it
Application::Run(gcnew Form1());
return 0;
}