Step1:
File->New->Project
Visual
C++ --> CLR --> CLR Empty Project
(type
name of the project as required and click OK) eg: MyProject
Step2:
Project ? Add New Item
Visual
C++ --> UI --> Windows Form
(type
name of the Form as required and click Add) eg: Form1.h
2
file will be created (Form1.h and Form1.cpp)
Step3:
Click on .cpp file and add the following
source code
#include "Form1.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void Main(array<String^>^ args)
{
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
MyProject::Form1 form;
Application::Run(%form);
}
Step4:
right click on the project properties
Configuration Properties --> Linker --> System --> SubSystem
Select
from drop down option for Windows (/SUBSYSTEM:WINDOWS)
Configuration Properties --> Linker -->
Advanced --> Entry Point
type
Main and click OK
Step5:
Run the application using F5
