
#pragma once
namespace My7 {
using namespace System;
using namespace System::ComponentModel;
using namespace System::Collections;
using namespace System::Windows::Forms;
using namespace System::Data;
using namespace System::Drawing;
///
/// Summary for Form1
///
/// WARNING: If you change the name of this class, you will need to change the
/// 'Resource File Name' property for the managed resource compiler tool
/// associated with all .resx files this class depends on. Otherwise,
/// the designers will not be able to interact properly with localized
/// resources associated with this form.
///
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
///
/// Clean up any resources being used.
///
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::PictureBox^ pct;
private: System::Windows::Forms::Button^ BtnDrawArc;
protected:
protected:
private:
///
/// Required designer variable.
///
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
void InitializeComponent(void)
{
this->pct = (gcnew System::Windows::Forms::PictureBox());
this->BtnDrawArc = (gcnew System::Windows::Forms::Button());
(cli::safe_cast
this->SuspendLayout();
//
// pct
//
this->pct->Location = System::Drawing::Point(15, 18);
this->pct->Name = L"pct";
this->pct->Size = System::Drawing::Size(281, 264);
this->pct->TabIndex = 0;
this->pct->TabStop = false;
//
// BtnDrawArc
//
this->BtnDrawArc->Location = System::Drawing::Point(127, 288);
this->BtnDrawArc->Name = L"BtnDrawArc";
this->BtnDrawArc->Size = System::Drawing::Size(74, 32);
this->BtnDrawArc->TabIndex = 1;
this->BtnDrawArc->Text = L"DrawArc";
this->BtnDrawArc->UseVisualStyleBackColor = true;
this->BtnDrawArc->Click += gcnew System::EventHandler(this, &Form1::BtnDrawArc_Click);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(312, 326);
this->Controls->Add(this->BtnDrawArc);
this->Controls->Add(this->pct);
this->Name = L"Form1";
this->Text = L"Form1";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
(cli::safe_cast
this->ResumeLayout(false);
}
#pragma endregion
//DrawArc
private: System::Void BtnDrawArc_Click(System::Object^ sender, System::EventArgs^ e) {
Graphics^TestGraphics;
Pen^HPen;
TestGraphics=pct->CreateGraphics();
HPen=gcnew Pen(Color::Yellow,2);
TestGraphics->DrawArc(HPen,10,10,200,200,50,160);
TestGraphics->DrawArc(HPen,50,10,150,150,100,250);
}
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
pct->BorderStyle=Windows::Forms::BorderStyle::Fixed3D;
pct->BackColor=Color::Black;
this->BackColor=Color::Green;
this->Text="DrawArc";
}
};
}