Welcome to C++ Form Programming using Visual Studio 13
1. Open Visual Studio 13.
2. Go to File->New->Project.
3. Go to Visual C++ and choose CLR Empty Project.
4. After this go to :
5. Go to Visual C++ -> UI -> Select Windows Form.
Will Look like this ->
6. Now Right click on Project<your project number> ( mine is Project6 so i will select Project6) and select properties and do same as me.
7. Go to Linker and under this select System and then select SubSystem from menu and click bottom-faced arrow and select the same as below.
8. Now, select Advanced, An Entry point row will come in menu and type "main" (without quotes).
9. Click Apply and Ok.
10. Now select your .cpp file from solution explorer in the right.
in my case its "MyForm.cpp"
11.Then type this code in your cpp file.
#include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;
[STAThread]
void main(array<String^>^ args) {
Application::EnableVisualStyles();
Application::SetCompatibleTextRenderingDefault(false);
Project1::MyForm form;
Application::Run(%form);
}
Note - It is advisory that make a project as "Project1" at a different place so there will be no chances of errors.
And if you changed the name of Project then you have to change the green highlighted line.
12. Save it and Click on "local Windows Debugger".
13 . Enjoy.Your First C++ GUI application is ready.
Place your Questions here :)
ReplyDeleteGreat😍
ReplyDeleteThank you XD
Delete