Sunday, September 25, 2011

Create HelloWorld Windows Form Application, using Visual C++ 2010 Express

Create HelloWorld Windows Form Application, using Visual C++ 2010 Express

- Create New Project using template of Visual C++ Windows Form Application, with Name of "HelloWorld", and click OK.
Create Visual C++ Windows Form Application

- Click on "Toolbox" on right to expand Toolbox, drag a label and button over the Form.
Place components

- Double Click on the button, to generate the code of button1_Click() method. Visual C++ will open the code designer for you.

- Add the code inside button1_Click() method:
 private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
label1->Text = "Hello World";
}
};

Add code

- Save and Run.
Click on the button, the text on the label will be changed to "Hello World".
Hello World

No comments:

Post a Comment