#pragma once
namespace My170597 {
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>
/// 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.
/// </summary>
public ref class Form1 : public System::Windows::Forms::Form
{
public:
Form1(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}
protected:
/// <summary>
/// Clean up any resources being used.
/// </summary>
~Form1()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Button^ calculateButton;
protected:
protected:
protected:
private: System::Windows::Forms::Label^ resultLabel;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::NumericUpDown^ valueNumericUpDown;
private: System::Windows::Forms::GroupBox^ groupBox1;
private:
/// <summary>
/// Required designer variable.
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
void InitializeComponent(void)
{
this->calculateButton = (gcnew System::Windows::Forms::Button());
this->resultLabel = (gcnew System::Windows::Forms::Label());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->valueNumericUpDown = (gcnew System::Windows::Forms::NumericUpDown());
this->groupBox1 = (gcnew System::Windows::Forms::GroupBox());
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->valueNumericUpDown))->BeginInit();
this->groupBox1->SuspendLayout();
this->SuspendLayout();
//
// calculateButton
//
// Это сгенерировано для кнопки
this->calculateButton->Location = System::Drawing::Point(85, 71);
this->calculateButton->Name = L"calculateButton";
this->calculateButton->Size = System::Drawing::Size(75, 23);
this->calculateButton->TabIndex = 0;
this->calculateButton->Text = L"Вычислить";
this->calculateButton->UseVisualStyleBackColor = true;
// Регистрация обработчика для события Click
this->calculateButton->Click += gcnew System::EventHandler(this, &Form1::calculateButto_Click);
//
// resultLabel
//
this->resultLabel->BorderStyle = System::Windows::Forms::BorderStyle::Fixed3D;
this->resultLabel->Location = System::Drawing::Point(137, 34);
this->resultLabel->Margin = System::Windows::Forms::Padding(3);
this->resultLabel->Name = L"resultLabel";
this->resultLabel->Size = System::Drawing::Size(100, 23);
this->resultLabel->TabIndex = 1;
this->resultLabel->TextAlign = System::Drawing::ContentAlignment::MiddleLeft;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Location = System::Drawing::Point(8, 14);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(58, 13);
this->label1->TabIndex = 3;
this->label1->Text = L"Значение:";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Location = System::Drawing::Point(140, 14);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(62, 13);
this->label2->TabIndex = 4;
this->label2->Text = L"Результат:";
//
// valueNumericUpDown
//
this->valueNumericUpDown->Location = System::Drawing::Point(11, 35);
this->valueNumericUpDown->Name = L"valueNumericUpDown";
this->valueNumericUpDown->Size = System::Drawing::Size(93, 20);
this->valueNumericUpDown->TabIndex = 5;
//
// groupBox1
//
this->groupBox1->Controls->Add(this->calculateButton);
this->groupBox1->Controls->Add(this->valueNumericUpDown);
this->groupBox1->Controls->Add(this->label2);
this->groupBox1->Controls->Add(this->resultLabel);
this->groupBox1->Controls->Add(this->label1);
this->groupBox1->Location = System::Drawing::Point(12, 12);
this->groupBox1->Margin = System::Windows::Forms::Padding(10);
this->groupBox1->Name = L"groupBox1";
this->groupBox1->Size = System::Drawing::Size(245, 100);
this->groupBox1->TabIndex = 6;
this->groupBox1->TabStop = false;
this->groupBox1->Text = L"Sqr(X)";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->AutoSize = true;
this->AutoSizeMode = System::Windows::Forms::AutoSizeMode::GrowAndShrink;
this->ClientSize = System::Drawing::Size(269, 123);
this->Controls->Add(this->groupBox1);
this->Name = L"Form1";
this->Text = L"Sqr(X)";
(cli::safe_cast<System::ComponentModel::ISupportInitialize^ >(this->valueNumericUpDown))->EndInit();
this->groupBox1->ResumeLayout(false);
this->groupBox1->PerformLayout();
this->ResumeLayout(false);
}
#pragma endregion
// Собственно обработчик
private: System::Void calculateButto_Click(System::Object^ sender, System::EventArgs^ e) {
// Пользоваться будем типами .NET, а не native
System::Decimal value=valueNumericUpDown->Value;
resultLabel->Text=(value*value).ToString();
}
};
}
for_each(my_map.begin(),my_map.end(),[](const pair_type& p)
{
wcout<<L"Key:"<<p.first.GetString()<<L"; ";
wcout<<L"Fields:";
for_each(p.second.begin(),p.second.end(),[](const CString& s)
{
wcout<<s.GetString()<<L',';
});
wcout<<"\b "<<endl;
});
for_each(my_map.begin(),my_map.end(),[](const pair_type& p)
{
wcout<<L"Key:"<<p.first.GetString()<<L"; ";
wcout<<L"Fields:";
ostream_iterator<wchar_t*,wchar_t> out(wcout,L",");
transform(p.second.begin(),p.second.end(),out,[](const CString& s)
{
return (wchar_t*)s.GetString();
});
wcout<<"\b "<<endl;
});
Если Вы уже зарегистрированы на Портале - войдите в систему, если Вы еще не регистрировались - пройдите простую процедуру регистрации.