⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.cpp

📁 这是一些c++例程
💻 CPP
字号:
#include "stdafx.h"
#include <windows.h>

#pragma once

namespace WinForm
{
	using namespace System;
	using namespace System::ComponentModel;
	using namespace System::Windows::Forms;
	using namespace System::Drawing;

	public __gc class Form1 : public System::Windows::Forms::Form
	{
	public:
		Form1(void)
		{
			InitializeComponent();
		}
  
	protected:
		void Dispose(Boolean disposing)
		{
			if (disposing && components)
			{
				components->Dispose();
			}
			__super::Dispose(disposing);
		}

	private:
		// 必需的设计器变量。
		System::ComponentModel::Container * components;

		void InitializeComponent(void)
		{
			this->Size = System::Drawing::Size(292, 273);			// 设置表单窗口大小
			this->Text = S"用托管C++开发Win表单应用程序";			// 设置表单窗口标题
			this->MaximizeBox = 0; 									// 禁止使用窗口的最大化按钮
		}	
	};
}

using namespace WinForm;

int APIENTRY _tWinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPTSTR    lpCmdLine,
                     int       nCmdShow)
{
	System::Threading::Thread::CurrentThread->ApartmentState = System::Threading::ApartmentState::STA;
	Application::Run(new Form1());
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -