?? form1.h
字號:
#pragma once
namespace Example
{
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
using namespace System::Drawing::Drawing2D;
/// <summary>
/// Form1 摘要
///
/// 警告: 如果您更改該類的名稱,則需要更改
/// 與該類所依賴的所有 .resx 文件關聯的托管資源編譯器工具的
/// “資源文件名”屬性。 否則,
/// 設計器將不能與此窗體關聯的
/// 本地化資源正確交互。
/// </summary>
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::Windows::Forms::Button * button1;
private:
/// <summary>
/// 必需的設計器變量。
/// </summary>
System::ComponentModel::Container * components;
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
void InitializeComponent(void)
{
System::Resources::ResourceManager * resources = new System::Resources::ResourceManager(__typeof(Example::Form1));
this->button1 = new System::Windows::Forms::Button();
this->SuspendLayout();
//
// button1
//
this->button1->Location = System::Drawing::Point(112, 80);
this->button1->Name = S"button1";
this->button1->Size = System::Drawing::Size(56, 23);
this->button1->TabIndex = 0;
this->button1->Text = S"關閉";
this->button1->Click += new System::EventHandler(this, button1_Click);
//
// Form1
//
this->AutoScaleBaseSize = System::Drawing::Size(6, 14);
this->BackgroundImage = (__try_cast<System::Drawing::Image * >(resources->GetObject(S"$this.BackgroundImage")));
this->ClientSize = System::Drawing::Size(352, 246);
this->Controls->Add(this->button1);
this->MaximizeBox = false;
this->Name = S"Form1";
this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
this->Text = S"演示創建圖形化的程序窗體";
this->Paint += new System::Windows::Forms::PaintEventHandler(this, Form1_Paint);
this->ResumeLayout(false);
}
private: System::Void Form1_Paint(System::Object * sender, System::Windows::Forms::PaintEventArgs * e)
{//創建圖形化的程序窗體
Point MyPoints[]={Point(10,50),Point(150,60),Point(200,80),Point(200,100),Point(320,140),Point(80,200)};
//創建一個路徑對象
GraphicsPath *MyPath;
MyPath=new GraphicsPath();
//將繪制的基數樣條圖形加入路徑
MyPath->AddClosedCurve(MyPoints);
//使用基數樣條圖形構造一個區域,并將此區域作為程序窗體區域
System::Drawing::Region *MyRegion=new System::Drawing::Region(MyPath);
this->Region=MyRegion;
}
private: System::Void button1_Click(System::Object * sender, System::EventArgs * e)
{//關閉程序
this->Close();
}
};
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -