
#pragma once
namespace My57 {
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::IO;
///
/// 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::Button^ BtnCreateDirectory;
private: System::Windows::Forms::TextBox^ txtDirectoryName;
protected:
private: System::Windows::Forms::Label^ lbl;
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->BtnCreateDirectory = (gcnew System::Windows::Forms::Button());
this->txtDirectoryName = (gcnew System::Windows::Forms::TextBox());
this->lbl = (gcnew System::Windows::Forms::Label());
this->SuspendLayout();
//
// BtnCreateDirectory
//
this->BtnCreateDirectory->BackColor = System::Drawing::Color::FromArgb(static_cast
static_cast
this->BtnCreateDirectory->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point,
static_cast
this->BtnCreateDirectory->ForeColor = System::Drawing::Color::White;
this->BtnCreateDirectory->Location = System::Drawing::Point(11, 88);
this->BtnCreateDirectory->Name = L"BtnCreateDirectory";
this->BtnCreateDirectory->Size = System::Drawing::Size(266, 94);
this->BtnCreateDirectory->TabIndex = 0;
this->BtnCreateDirectory->Text = L"Create Directory";
this->BtnCreateDirectory->UseVisualStyleBackColor = false;
this->BtnCreateDirectory->Click += gcnew System::EventHandler(this, &Form1::BtnCreateDirectory_Click);
//
// txtDirectoryName
//
this->txtDirectoryName->BackColor = System::Drawing::Color::FromArgb(static_cast
static_cast
this->txtDirectoryName->ForeColor = System::Drawing::Color::Blue;
this->txtDirectoryName->Location = System::Drawing::Point(21, 48);
this->txtDirectoryName->Name = L"txtDirectoryName";
this->txtDirectoryName->Size = System::Drawing::Size(256, 20);
this->txtDirectoryName->TabIndex = 1;
//
// lbl
//
this->lbl->AutoSize = true;
this->lbl->ForeColor = System::Drawing::Color::Yellow;
this->lbl->Location = System::Drawing::Point(17, 16);
this->lbl->Name = L"lbl";
this->lbl->Size = System::Drawing::Size(89, 13);
this->lbl->TabIndex = 2;
this->lbl->Text = L"Directory Name : ";
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::Color::FromArgb(static_cast
static_cast
this->ClientSize = System::Drawing::Size(292, 197);
this->Controls->Add(this->lbl);
this->Controls->Add(this->txtDirectoryName);
this->Controls->Add(this->BtnCreateDirectory);
this->Name = L"Form1";
this->Text = L"Form1";
this->ResumeLayout(false);
this->PerformLayout();
}
#pragma endregion
//Create Directory
private: System::Void BtnCreateDirectory_Click(System::Object^ sender, System::EventArgs^ e) {
if(txtDirectoryName->Text!="")
{
Directory::CreateDirectory("C:\\"+txtDirectoryName->Text);
MessageBox::Show("Create Directory Completed");
}
}
};
}