Tajriba ishi №4 Mavzu




Download 5,66 Mb.
bet9/9
Sana20.05.2024
Hajmi5,66 Mb.
#244731
1   2   3   4   5   6   7   8   9
Bog'liq
visual studio

Formalarni bog‘lash






Moxichexra Rustamova, [30.04.2024 14:37]
#pragma once
#include"Form2.h"
#include"Form3.h"
namespace kup_forma {

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
///

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^ button1;
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::TextBox^ textBox2;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Button^ button2;
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->button1 = (gcnew System::Windows::Forms::Button());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->textBox2 = (gcnew System::Windows::Forms::TextBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->button2 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// button1
//
this->button1->BackColor = System::Drawing::SystemColors::ScrollBar;
this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 16.2F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->button1->Location = System::Drawing::Point(75, 300);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(147, 51);
this->button1->TabIndex = 0;
this->button1->Text = L"Kirish";
this->button1->UseVisualStyleBackColor = false;
this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(252, 85);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(100, 22);
this->textBox1->TabIndex = 1;
//
// textBox2
//
this->textBox2->Location = System::Drawing::Point(252, 154);
this->textBox2->Name = L"textBox2";
this->textBox2->Size = System::Drawing::Size(100, 22);
this->textBox2->TabIndex = 2;
//
// label1
//
this->label1->AutoSize = true;
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 13.8F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label1->Location = System::Drawing::Point(70, 78);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(78, 29);
this->label1->TabIndex = 3;
this->label1->Text = L"login:";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 13.8F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label2->Location = System::Drawing::Point(68, 154);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(80, 29);
this->label2->TabIndex = 4;
this->label2->Text = L"parol:";
//
// button2
//
this->button2->BackColor = System::Drawing::SystemColors::ScrollBar;
this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 13.8F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->button2->Location = System::Drawing::Point(315, 300);
this->button2->Name = L"button2";
this->button2->Size = System::Drawing::Size(132, 51);
this->button2->TabIndex = 5;
this->button2->Text = L"Chiqish :";
this->button2->UseVisualStyleBackColor = false;
this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
//
// Form1
//
this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->ClientSize = System::Drawing::Size(505, 488);
this->Controls->Add(this->button2);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->textBox2);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->button1);
this->Name = L"Form1";
this->Text = L"Form1";
this->Load += gcnew System::EventHandler(this, &Form1::Form1_Load);
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion


private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
if(textBox1->Text=="Asilbek"&&textBox2->Text=="1111")
{
Form2^ F2=gcnew Form2();
F2->Show(); //formani ko'rsatish
this->Hide(); //2-formaga o'tganda 1-forma yopilsin
}
else
{
System::Windows::Forms::DialogResult rez;
rez=MessageBox::Show("Login yoki Parolda xatolik bor", "Xabar");
if (rez==System::Windows::Forms::DialogResult::OK)
{

Form3^ F3=gcnew Form3();


F3->Show(); //formani ko'rsatish
this->Hide(); //3-formaga o'tganda 1-forma yopilsin
}
}
}
private: System::Void Form1_Load(System::Object^ sender, System::EventArgs^ e) {
textBox2->PasswordChar='@';
}
private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
Close();
}
};
}
#pragma once

namespace kup_forma {


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 Form2
///

public ref class Form2 : public System::Windows::Forms::Form
{
public:
Form2(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}

protected:


///
/// Clean up any resources being used.
///

~Form2()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::PictureBox^ pictureBox1;
protected:
private: System::Windows::Forms::PictureBox^ pictureBox2;
private: System::Windows::Forms::PictureBox^ pictureBox3;
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::Label^ label5;
private: System::Windows::Forms::Label^ label6;
private: System::Windows::Forms::Label^ label7;
private: System::Windows::Forms::Label^ label8;
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)
{
System::ComponentModel::ComponentResourceManager^ resources = (gcnew System::ComponentModel::ComponentResourceManager(Form2::typeid));
this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
this->pictureBox2 = (gcnew System::Windows::Forms::PictureBox());
this->pictureBox3 = (gcnew System::Windows::Forms::PictureBox());
this->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->label5 = (gcnew System::Windows::Forms::Label());
this->label6 = (gcnew System::Windows::Forms::Label());
this->label7 = (gcnew System::Windows::Forms::Label());
this->label8 = (gcnew System::Windows::Forms::Label());
(cli::safe_cast(this->pictureBox1))->BeginInit();
(cli::safe_cast(this->pictureBox2))->BeginInit();
(cli::safe_cast(this->pictureBox3))->BeginInit();
this->SuspendLayout();
//
// pictureBox1
//
this->pictureBox1->Image = (cli::safe_cast(resources->GetObject(L"pictureBox1.Image")));
this->pictureBox1->Location = System::Drawing::Point(-1, -1);
this->pictureBox1->Name = L"pictureBox1";
this->pictureBox1->Size = System::Drawing::Size(947, 654);
this->pictureBox1->SizeMode = System::Windows::Forms::PictureBoxSizeMode::Zoom;
this->pictureBox1->TabIndex = 0;
this->pictureBox1->TabStop = false;
//
// pictureBox2
//
this->pictureBox2->Image = (cli::safe_cast(resources->GetObject(L"pictureBox2.Image")));
this->pictureBox2->Location = System::Drawing::Point(-167, 54);
this->pictureBox2->Name = L"pictureBox2";
this->pictureBox2->Size = System::Drawing::Size(100, 113);
this->pictureBox2->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
this->pictureBox2->TabIndex = 1;
this->pictureBox2->TabStop = false;
//
// pictureBox3
//
this->pictureBox3->Image = (cli::safe_cast(resources->GetObject(L"pictureBox3.Image")));

this->pictureBox3->InitialImage = (cli::safe_cast(resources->GetObject(L"pictureBox3.InitialImage")));


this->pictureBox3->Location = System::Drawing::Point(786, 20);
this->pictureBox3->Name = L"pictureBox3";
this->pictureBox3->Size = System::Drawing::Size(138, 174);
this->pictureBox3->SizeMode = System::Windows::Forms::PictureBoxSizeMode::StretchImage;
this->pictureBox3->TabIndex = 2;
this->pictureBox3->TabStop = false;
//
// label1
//
this->label1->AutoSize = true;
this->label1->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 16.2F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label1->Location = System::Drawing::Point(430, 9);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(236, 37);
this->label1->TabIndex = 3;
this->label1->Text = L"Shaxsiy kabinet";
//
// label2
//
this->label2->AutoSize = true;
this->label2->BackColor = System::Drawing::Color::LightCyan;
this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label2->Location = System::Drawing::Point(66, 64);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(151, 27);
this->label2->TabIndex = 4;
this->label2->Text = L"JAHONGIROV";
//
// label3
//
this->label3->AutoSize = true;
this->label3->BackColor = System::Drawing::Color::LightCyan;
this->label3->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label3->Location = System::Drawing::Point(66, 113);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(96, 27);
this->label3->TabIndex = 5;
this->label3->Text = L"ASILBEK";
//
// label4
//
this->label4->AutoSize = true;
this->label4->BackColor = System::Drawing::Color::LightCyan;
this->label4->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label4->Location = System::Drawing::Point(66, 167);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(208, 27);
this->label4->TabIndex = 6;
this->label4->Text = L"JAMOLIDDIN O\'GLI";
//
// label5
//
this->label5->AutoSize = true;
this->label5->BackColor = System::Drawing::Color::LightBlue;
this->label5->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label5->Location = System::Drawing::Point(41, 518);
this->label5->Name = L"label5";
this->label5->Size = System::Drawing::Size(98, 27);
this->label5->TabIndex = 7;
this->label5->Text = L"Manzil : ";
//
// label6
//
this->label6->AutoSize = true;
this->label6->BackColor = System::Drawing::Color::LightCyan;
this->label6->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label6->Location = System::Drawing::Point(161, 518);
this->label6->Name = L"label6";
this->label6->Size = System::Drawing::Size(720, 27);
this->label6->TabIndex = 8;
this->label6->Text = L"Qashqadaryo viloyati Yakkabog\' tuman Qo\'shchinor mahallasi 204-uy";
//
// label7
//
this->label7->AutoSize = true;

this->label7->BackColor = System::Drawing::Color::PowderBlue;


this->label7->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label7->Location = System::Drawing::Point(320, 72);
this->label7->Name = L"label7";
this->label7->Size = System::Drawing::Size(182, 27);
this->label7->TabIndex = 9;
this->label7->Text = L"Tug\'ilgan sanasi:";
//
// label8
//
this->label8->AutoSize = true;
this->label8->BackColor = System::Drawing::Color::LightCyan;
this->label8->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label8->Location = System::Drawing::Point(533, 72);
this->label8->Name = L"label8";
this->label8->Size = System::Drawing::Size(120, 27);
this->label8->TabIndex = 10;
this->label8->Text = L"04.02.2004";
//
// Form2
//
this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(948, 655);
this->Controls->Add(this->label8);
this->Controls->Add(this->label7);
this->Controls->Add(this->label6);
this->Controls->Add(this->label5);
this->Controls->Add(this->label4);
this->Controls->Add(this->label3);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Controls->Add(this->pictureBox3);
this->Controls->Add(this->pictureBox2);
this->Controls->Add(this->pictureBox1);
this->Name = L"Form2";
this->Text = L"Form2";
(cli::safe_cast(this->pictureBox1))->EndInit();
(cli::safe_cast(this->pictureBox2))->EndInit();
(cli::safe_cast(this->pictureBox3))->EndInit();
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion


private: System::Void pictureBox4_Click(System::Object^ sender, System::EventArgs^ e) {
}
};
}
#pragma once

namespace kup_forma {


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 Form3
///

public ref class Form3 : public System::Windows::Forms::Form
{
public:
Form3(void)
{
InitializeComponent();
//
//TODO: Add the constructor code here
//
}

protected:


///
/// Clean up any resources being used.
///

~Form3()
{
if (components)
{
delete components;
}
}
private: System::Windows::Forms::Label^ label1;
private: System::Windows::Forms::Label^ label2;
private: System::Windows::Forms::Label^ label3;
private: System::Windows::Forms::Label^ label4;
private: System::Windows::Forms::TextBox^ textBox1;
private: System::Windows::Forms::TextBox^ textBox2;
private: System::Windows::Forms::TextBox^ textBox3;
private: System::Windows::Forms::Button^ button1;
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->label1 = (gcnew System::Windows::Forms::Label());
this->label2 = (gcnew System::Windows::Forms::Label());
this->label3 = (gcnew System::Windows::Forms::Label());
this->label4 = (gcnew System::Windows::Forms::Label());
this->textBox1 = (gcnew System::Windows::Forms::TextBox());
this->textBox2 = (gcnew System::Windows::Forms::TextBox());
this->textBox3 = (gcnew System::Windows::Forms::TextBox());
this->button1 = (gcnew System::Windows::Forms::Button());
this->SuspendLayout();
//
// label1
//
this->label1->AutoSize = true;
this->label1->BackColor = System::Drawing::SystemColors::ActiveCaption;
this->label1->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 13.8F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label1->Location = System::Drawing::Point(153, 37);
this->label1->Name = L"label1";
this->label1->Size = System::Drawing::Size(299, 31);
this->label1->TabIndex = 0;
this->label1->Text = L"Qayta ro\'yxatdan o\'tish";
//
// label2
//
this->label2->AutoSize = true;
this->label2->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label2->Location = System::Drawing::Point(83, 113);
this->label2->Name = L"label2";
this->label2->Size = System::Drawing::Size(190, 27);
this->label2->TabIndex = 1;
this->label2->Text = L"Loginnni kiriting :";
//
// label3
//
this->label3->AutoSize = true;
this->label3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label3->Location = System::Drawing::Point(106, 183);
this->label3->Name = L"label3";
this->label3->Size = System::Drawing::Size(167, 25);
this->label3->TabIndex = 2;
this->label3->Text = L"Parolni kiriting : ";
//
// label4
//
this->label4->AutoSize = true;
this->label4->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 12, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->label4->Location = System::Drawing::Point(38, 247);
this->label4->Name = L"label4";
this->label4->Size = System::Drawing::Size(235, 27);
this->label4->TabIndex = 3;
this->label4->Text = L"Parolni qayta kiriting :";
//
// textBox1
//
this->textBox1->Location = System::Drawing::Point(338, 118);
this->textBox1->Name = L"textBox1";
this->textBox1->Size = System::Drawing::Size(100, 22);
this->textBox1->TabIndex = 4;
//
// textBox2
//
this->textBox2->Location = System::Drawing::Point(338, 187);
this->textBox2->Name = L"textBox2";
this->textBox2->Size = System::Drawing::Size(100, 22);
this->textBox2->TabIndex = 5;
//
// textBox3
//
this->textBox3->Location = System::Drawing::Point(338, 252);
this->textBox3->Name = L"textBox3";
this->textBox3->Size = System::Drawing::Size(100, 22);
this->textBox3->TabIndex = 6;
//
// button1
//
this->button1->BackColor = System::Drawing::SystemColors::GradientInactiveCaption;
this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft YaHei", 13.8F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
static_cast(204)));
this->button1->Location = System::Drawing::Point(111, 411);
this->button1->Name = L"button1";
this->button1->Size = System::Drawing::Size(207, 57);
this->button1->TabIndex = 7;
this->button1->Text = L"Tizimga kirish";
this->button1->UseVisualStyleBackColor = false;
this->button1->Click += gcnew System::EventHandler(this, &Form3::button1_Click);
//
// Form3
//
this->AutoScaleDimensions = System::Drawing::SizeF(8, 16);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(620, 568);
this->Controls->Add(this->button1);
this->Controls->Add(this->textBox3);
this->Controls->Add(this->textBox2);
this->Controls->Add(this->textBox1);
this->Controls->Add(this->label4);
this->Controls->Add(this->label3);
this->Controls->Add(this->label2);
this->Controls->Add(this->label1);
this->Name = L"Form3";
this->Text = L"Form3";
this->ResumeLayout(false);
this->PerformLayout();

}
#pragma endregion


private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
if(textBox1->Text=="Asilbek" && textBox2->Text=="1111" && textBox3->Text=="1111"){
this->Hide(); //forma ko'rinmas holatga o'tsin
System::Windows::Forms::DialogResult res;
res=MessageBox::Show("TIZIMGA KIRISH MUVAFFAQIYATLI AMALGA OSHIRILDI!!!", "Xabar");
if (res==System::Windows::Forms::DialogResult::OK){
Close();
}
}else {
this->Hide();
System::Windows::Forms::DialogResult rel;
rel=MessageBox::Show("Ro'yxatdan o'tishda xatolik bor!!!", "Xabar");
if (rel==System::Windows::Forms::DialogResult::OK){
Close();
}
}
}
};
}
Download 5,66 Mb.
1   2   3   4   5   6   7   8   9




Download 5,66 Mb.