C++ Tutorial - UI Application using visual studio 2012
2015-04-15 14:46
471 查看
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:
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).
- See more at: http://www.bogotobogo.com/cplusplus/application_visual_studio_2013.php#sthash.ki4tvyDQ.dpuf
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).
- See more at: http://www.bogotobogo.com/cplusplus/application_visual_studio_2013.php#sthash.ki4tvyDQ.dpuf
相关文章推荐
- How to debug c++ console application with argument in visual studio 2012
- 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
- Building Ogre in Windows 7/8 using Visual Studio 2012
- 【.Net码农】安装程序打包MFC(visual studio安装部署详解)Install Application Package by using visual studion 2010
- How to build python3.3 using Visual Studio 2012 Ultimate
- Error when Publishing Website using Visual Studio 2012
- If you have multiple web application run how to determin which is yours when you debug using visual studio 2008?
- First ASP.NET Core Application on a Mac Using Visual Studio Code
- Using UTF-8 as the internal representation for strings in C and C++ with Visual Studio
- Xerces for C++ Tutorial using Visual C++(转载)
- Using Threading to Build a Responsive Application with Visual Studio 2005
- N-Tier application design using Visual Studio 2005 (Draft)
- win 2012 安装mysql 5.7.20 及报错 This application requires Visual Studio 2013 Redistributable. Please ins
- Windows XP Targeting with C++ in Visual Studio 2012
- c# Using Settings under visual studio 2012
- Develop 3Ds Max 9 plugin using Visual studio C++ Express Edition(转载自我的Space)
- Using color themes with Visual Studio 2012 Express Editions
- 安装程序打包MFC(visual studio安装部署详解)Install Application Package by using visual studion 2010
- win 2012 安装mysql 5.7.20 及报错 This application requires Visual Studio 2013 Redistributable. Please install the Redistributable then run this installer again 的解决办法