Sharof rashidov nomidagi samarqand davlat universiteti intelektual tizimlar va innvation tizimlar fakulteti dasturiy injinirngi yo
Download 80.4 Kb.
|
Javohir Achilov Labaratoriya
4-Topshiriq.
Masala sharti: (3) Birinchi listBoxda foydalanuvchilarning ismi va familiyalari berilgan. 2-listBoxda ushbu ism familiyalarni faqat bosh harfda chop eting Dasturning visual ko’rinishi. Dastur kodi: #pragma once namespace chopetish { 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 MyForm /// public ref class MyForm : public System::Windows::Forms::Form { public: MyForm(void) { InitializeComponent(); // //TODO: Add the constructor code here // } protected: /// /// Clean up any resources being used. /// ~MyForm() { if (components) { delete components; } } private: System::Windows::Forms::ListBox^ kiruvchi_malumotlar; private: System::Windows::Forms::ListBox^ chiquvchi_malumotlar; protected: protected: protected: protected: private: System::Windows::Forms::TextBox^ ism; private: System::Windows::Forms::TextBox^ familya; private: System::Windows::Forms::Button^ button2; private: System::Windows::Forms::Label^ i; private: System::Windows::Forms::Label^ f; private: System::Windows::Forms::Button^ button3; private: System::Windows::Forms::Button^ button4; private: System::Windows::Forms::Button^ button5; private: System::Windows::Forms::Button^ button6; private: System::Windows::Forms::Button^ button1; private: System::Windows::Forms::Button^ button15; private: System::ComponentModel::IContainer^ components; protected: private: /// /// Required designer variable. /// #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(MyForm::typeid)); this->kiruvchi_malumotlar = (gcnew System::Windows::Forms::ListBox()); this->chiquvchi_malumotlar = (gcnew System::Windows::Forms::ListBox()); this->ism = (gcnew System::Windows::Forms::TextBox()); this->familya = (gcnew System::Windows::Forms::TextBox()); this->button2 = (gcnew System::Windows::Forms::Button()); this->i = (gcnew System::Windows::Forms::Label()); this->f = (gcnew System::Windows::Forms::Label()); this->button3 = (gcnew System::Windows::Forms::Button()); this->button4 = (gcnew System::Windows::Forms::Button()); this->button5 = (gcnew System::Windows::Forms::Button()); this->button6 = (gcnew System::Windows::Forms::Button()); this->button1 = (gcnew System::Windows::Forms::Button()); this->button15 = (gcnew System::Windows::Forms::Button()); this->SuspendLayout(); // // kiruvchi_malumotlar // this->kiruvchi_malumotlar->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->kiruvchi_malumotlar->FormattingEnabled = true; this->kiruvchi_malumotlar->Location = System::Drawing::Point(2, 34); this->kiruvchi_malumotlar->Name = L"kiruvchi_malumotlar"; this->kiruvchi_malumotlar->Size = System::Drawing::Size(239, 173); this->kiruvchi_malumotlar->TabIndex = 0; // // chiquvchi_malumotlar // this->chiquvchi_malumotlar->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->chiquvchi_malumotlar->FormattingEnabled = true; this->chiquvchi_malumotlar->Location = System::Drawing::Point(236, 34); this->chiquvchi_malumotlar->Name = L"chiquvchi_malumotlar"; this->chiquvchi_malumotlar->Size = System::Drawing::Size(201, 173); this->chiquvchi_malumotlar->TabIndex = 1; // // ism // this->ism->Location = System::Drawing::Point(113, 95); this->ism->Name = L"ism"; this->ism->Size = System::Drawing::Size(117, 20); this->ism->TabIndex = 4; this->ism->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &MyForm::ism_KeyPress); // // familya // this->familya->Location = System::Drawing::Point(113, 125); this->familya->Name = L"familya"; this->familya->Size = System::Drawing::Size(117, 20); this->familya->TabIndex = 5; this->familya->KeyPress += gcnew System::Windows::Forms::KeyPressEventHandler(this, &MyForm::familya_KeyPress); // // button2 // this->button2->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->button2->Font = (gcnew System::Drawing::Font(L"Microsoft Tai Le", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->button2->Location = System::Drawing::Point(28, 64); this->button2->Name = L"button2"; this->button2->Size = System::Drawing::Size(177, 23); this->button2->TabIndex = 7; this->button2->Text = L"Foydalanuvchi malumoti"; this->button2->UseVisualStyleBackColor = false; // // i // this->i->AutoSize = true; this->i->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->i->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast this->i->ForeColor = System::Drawing::SystemColors::ActiveCaptionText; this->i->Location = System::Drawing::Point(247, 106); this->i->Name = L"i"; this->i->Size = System::Drawing::Size(39, 20); this->i->TabIndex = 8; this->i->Text = L"Ism:"; // // f // this->f->AutoSize = true; this->f->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->f->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 12, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast this->f->Location = System::Drawing::Point(247, 146); this->f->Name = L"f"; this->f->Size = System::Drawing::Size(67, 20); this->f->TabIndex = 9; this->f->Text = L"Familya:"; // // button3 // this->button3->BackColor = System::Drawing::Color::Aqua; this->button3->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->button3->Location = System::Drawing::Point(12, 93); this->button3->Name = L"button3"; this->button3->Size = System::Drawing::Size(78, 23); this->button3->TabIndex = 10; this->button3->Text = L"Ism"; this->button3->UseVisualStyleBackColor = false; // // button4 // this->button4->BackColor = System::Drawing::Color::Aqua; this->button4->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->button4->Location = System::Drawing::Point(12, 122); this->button4->Name = L"button4"; this->button4->Size = System::Drawing::Size(80, 23); this->button4->TabIndex = 11; this->button4->Text = L"Familya"; this->button4->UseVisualStyleBackColor = false; // // button5 // this->button5->BackColor = System::Drawing::Color::Turquoise; this->button5->FlatAppearance->BorderSize = 0; this->button5->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 11, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->button5->ForeColor = System::Drawing::Color::White; this->button5->Image = (cli::safe_cast this->button5->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft; this->button5->Location = System::Drawing::Point(162, 159); this->button5->Margin = System::Windows::Forms::Padding(2); this->button5->Name = L"button5"; this->button5->Size = System::Drawing::Size(43, 42); this->button5->TabIndex = 13; this->button5->UseVisualStyleBackColor = false; this->button5->Click += gcnew System::EventHandler(this, &MyForm::button5_Click); // // button6 // this->button6->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->button6->Font = (gcnew System::Drawing::Font(L"Microsoft Tai Le", 9.75F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->button6->Image = (cli::safe_cast this->button6->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft; this->button6->Location = System::Drawing::Point(247, 56); this->button6->Name = L"button6"; this->button6->Size = System::Drawing::Size(186, 39); this->button6->TabIndex = 14; this->button6->Text = L" Chiquvchi malumotlar"; this->button6->UseVisualStyleBackColor = false; // // button1 // this->button1->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->button1->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 10.2F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point, static_cast this->button1->Image = (cli::safe_cast this->button1->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft; this->button1->Location = System::Drawing::Point(12, 161); this->button1->Margin = System::Windows::Forms::Padding(2); this->button1->Name = L"button1"; this->button1->Size = System::Drawing::Size(123, 40); this->button1->TabIndex = 15; this->button1->Text = L" Chop etish"; this->button1->UseVisualStyleBackColor = false; this->button1->Click += gcnew System::EventHandler(this, &MyForm::button1_Click_1); // // button15 // this->button15->BackColor = System::Drawing::Color::FromArgb(static_cast static_cast this->button15->BackgroundImageLayout = System::Windows::Forms::ImageLayout::Zoom; this->button15->FlatAppearance->BorderSize = 0; this->button15->FlatAppearance->MouseOverBackColor = System::Drawing::Color::Black; this->button15->FlatStyle = System::Windows::Forms::FlatStyle::Flat; this->button15->Font = (gcnew System::Drawing::Font(L"Microsoft Sans Serif", 9.25F, System::Drawing::FontStyle::Regular, System::Drawing::GraphicsUnit::Point, static_cast this->button15->ForeColor = System::Drawing::Color::Black; this->button15->Image = (cli::safe_cast this->button15->ImageAlign = System::Drawing::ContentAlignment::MiddleLeft; this->button15->Location = System::Drawing::Point(136, 1); this->button15->Name = L"button15"; this->button15->Size = System::Drawing::Size(150, 37); this->button15->TabIndex = 16; this->button15->Text = L"Muallif haqida"; this->button15->TextAlign = System::Drawing::ContentAlignment::MiddleRight; this->button15->UseVisualStyleBackColor = false; this->button15->Click += gcnew System::EventHandler(this, &MyForm::button15_Click); // // MyForm // this->AutoScaleDimensions = System::Drawing::SizeF(6, 13); this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font; this->BackColor = System::Drawing::Color::LightGray; this->ClientSize = System::Drawing::Size(440, 209); this->Controls->Add(this->button15); this->Controls->Add(this->button1); this->Controls->Add(this->button6); this->Controls->Add(this->button5); this->Controls->Add(this->button4); this->Controls->Add(this->button3); this->Controls->Add(this->f); this->Controls->Add(this->i); this->Controls->Add(this->button2); this->Controls->Add(this->familya); this->Controls->Add(this->ism); this->Controls->Add(this->chiquvchi_malumotlar); this->Controls->Add(this->kiruvchi_malumotlar); this->Name = L"MyForm"; this->Text = L"MyForm"; this->ResumeLayout(false); this->PerformLayout(); }
private: System::Void ism_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e) { if (!Char::IsControl(e->KeyChar) && Char::IsDigit(e->KeyChar)) { e->Handled = true; } } private: System::Void familya_KeyPress(System::Object^ sender, System::Windows::Forms::KeyPressEventArgs^ e) { if (!Char::IsControl(e->KeyChar) && Char::IsDigit(e->KeyChar)) { e->Handled = true; } } private: System::Void menuStrip1_ItemClicked(System::Object^ sender, System::Windows::Forms::ToolStripItemClickedEventArgs^ e) { } private: System::Void pictureBox9_Click(System::Object^ sender, System::EventArgs^ e) { MessageBox::Show("Ushbu dastur kiritilgan malumotlarni faqat bosh harfda chiqaradi!", "Dastur haqida", MessageBoxButtons::OK, MessageBoxIcon::Exclamation); } private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) { ism->Text = ""; familya->Text = ""; } private: System::Void button1_Click_1(System::Object^ sender, System::EventArgs^ e) { if (ism->Text == "" && familya->Text == "") MessageBox::Show("Qiymatlar kiritilmadi!", "Xatolik", MessageBoxButtons::OK, MessageBoxIcon::Error); else if (ism->Text == "") MessageBox::Show("Ismga qiymat kiritilmadi!", "Xatolik", MessageBoxButtons::OK, MessageBoxIcon::Error); else if (familya->Text == "") MessageBox::Show("Familyaga qiymat kiritilmadi!", "Xatolik", MessageBoxButtons::OK, MessageBoxIcon::Error); else { String ^a = ism->Text, ^b = familya->Text; i->Text = "Ism:" + a->ToUpper(); f->Text = "Familya:" + b->ToUpper(); } } private: System::Void button15_Click(System::Object^ sender, System::EventArgs^ e) { MessageBox::Show("Ushbu dastur Samarqand Davlat Universiteti talabasi tomonidan yaratildi.Dastur kiritilgan malumotlarni katta harflarda chiqaradi !", "Xabar", MessageBoxButtons::OK, MessageBoxIcon::Information); } private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e) { }; } Download 80.4 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling