📄 hellowinforms.cpp
字号:
// This is the main project file for VC++ application project
// generated using an Application Wizard.
#include "stdafx.h"
#using <mscorlib.dll>
#using <System.dll>
#using <System.Drawing.dll>
#using <System.Windows.Forms.dll>
#include <tchar.h>
using namespace System;
using namespace System::ComponentModel;
using namespace System::Drawing;
using namespace System::Windows::Forms;
__gc class MyForm : public Form
{
public:
MyForm();
protected:
void OnClick(Object *sender, System::EventArgs* e);
};
MyForm::MyForm()
{
Text = "My First Windows Forms Application";
add_Click(new EventHandler(this, &MyForm::OnClick));
}
void MyForm::OnClick(Object *sender, System::EventArgs* e)
{
MessageBox::Show("Hello, Windows Forms!");
}
int __stdcall WinMain()
{
// Instantiate a MyForm object.
MyForm* pMyForm = new MyForm();
// Create and display the form and
// start the message loop to control messaging.
Application::Run(pMyForm);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -