C++ Tutorial - UI Application using visual studio 2012
来源:互联网 发布:巴黎地铁游客数据 编辑:程序博客网 时间:2024/05/31 19:49
THE SIMPLEST UI PROGRAM
- Select Visual C++ CLR and CLR Empty Project
and type in RandomNumberGenerator for the project name. The, OK. - Project->Add New Item... .
Select UI under Visual C++.
Leave the Form name as given by default MyForm.h.
Then, click Add.
- We need to 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::MyForm form;Application::Run(%form);}
The System namespace provides functions to work with UI controls. - At the right-mouse click on RandomNumberGenerator, we get the Properties window.
Configuration Properties->Linker->System
Select Windows (/SUBSYSTEM:WINDOWS) for SubSystem.
Advanced->Entry Point, type in Main.
The, hit OK. - Hit F5, then we will have to run result, the Form.
UI SETUP
- Locate the ToolBox, and then expand the list of Common Controls.
Double-click its Label items to add it to our Form.
Do this seven times.
We need to add two Buttons and a PixtureBox.
Double-click those as well from the list. - Resize and rearrange the items. Rename the buttons and tile of the Form, then it should look like this:
- We can put the picture onto the PictureBox.
At a right mouse click, we get Choosing Picture....
Then, select the image file we want to use. - Let's try if it works.
Run it (Hit F5).
0 0
- C++ Tutorial - UI Application using visual studio 2012
- Using OpenCV 2.4.x with Visual Studio 2010 (tutorial)
- Xerces for C++ Tutorial using Visual C++(转载)
- Visual Studio 2010 UI
- Automating Excel 2007 and creating charts using C++ MFC application in Visual Studio 2008
- 安装程序打包MFC(visual studio安装部署详解)Install Application Package by using visual studion 2010
- 【.Net码农】安装程序打包MFC(visual studio安装部署详解)Install Application Package by using visual studion 2010
- 安装程序打包MFC(visual studio安装部署详解)Install Application Package by using visual studion 2010
- Visual Studio 2012 编译C
- Using GDB in Visual Studio
- Using color themes with Visual Studio 2012 Express Editions
- Error when Publishing Website using Visual Studio 2012
- Building Ogre in Windows 7/8 using Visual Studio 2012
- Using Lua with C++: A short tutorial
- Using Properties in Objective-C Tutorial 边看边记
- Using UTF-8 as the internal representation for strings in C and C++ with Visual Studio
- vtk编译出现"Check for working C compiler using: Visual Studio 10 -- broken"
- Visual Studio 2012中编写C程序
- GET 和 POST两种调用方式
- Android开发之Activity的生命周期
- 第五周 项目四 静态成员应用
- mysql中文乱码问题
- get、post获取参数的区别
- C++ Tutorial - UI Application using visual studio 2012
- ZOJ Problem Set - 3861 ( DFS + 子集生成 + 有条件的全排列生成 )
- SQL查询入门(上篇)
- Ubuntu使用之输入法开机启动设置
- JIRA从HSQL切换到MySQL
- a++和++a可不可以作为左值
- Javascript 类型判定
- 【计科13】教材的中文电子版已经上传,供参考!
- SQL查询入门(中篇)