You are on page 1of 17

HOW TO CREATE A VISUAL

INTERFACE
IN
C++

Mr. Priyanga Siriwardana

Start with new Project

Create a new Project in


CLR

Adding a Form

Adding a windows form

UI Background

Edit the MyForm.cpp


file

#include "MyForm.h"
using namespace System;
using namespace System::Windows::Forms;

[STAThread]
void Main(array<String^>^ args)
{

Application::EnableVisualStyles();

Application::SetCompatibleTextRenderingDefault(false);

RandomNumberGenerator::MyFormform;
Application::Run(%form);

Edit the Code

Change the sub system

Run the program

This will be output

Put a label and button

Text box and Button

You might also like