Axborot tеxnologiyalari univеrsitеti


-qadam: 1- formaga boshqa formalarni bog‘lash uchun quyidagi kodlar kiritiladi: #include



Download 5,98 Mb.
bet63/134
Sana20.07.2022
Hajmi5,98 Mb.
#829272
1   ...   59   60   61   62   63   64   65   66   ...   134
1-qadam: 1- formaga boshqa formalarni bog‘lash uchun quyidagi kodlar kiritiladi: #include "Form2.h"; #include "Form3.h"; #include "Form31.h";

3.17-rasm. 1-formaning ko‘rinishi

1- forma 2- formaga bog‘lanishi uchun CheckBox tugmasining


Onclick hodisasiga quyidagi kodlar kiritiladi:

  1. Form2^ open=gcnew Form2();

  2. this->Hide(); open->Show();

1- forma 3- formaga bog‘lanishi uchun CheckListBox
tugmasining Onclick hodisasiga quyidagi kodlar kiritiladi:

  1. Form3^ open=gcnew Form3();

  2. this->Hide(); open->Show();

    1. forma 3- formaga bog‘lanish uchun ComboBox tugmasining

Onclick hodisasiga quyidagi kodlar kiritiladi:

  1. Form3^ open=gcnew Form3();

  2. this->Hide(); open->Show();

    1. qadam: 32 – variantdagi masalani yechish uchun 2- formada button ning Onclick hodisasiga quyidagi kodlar kiritiladi:

1. private: System::Void button1_Click(System::Object^ sender,System::EventArgs^ e) {
2. int a[10][10]; s=0; int n,m;

  1. if(textBox1->Text!="" && textBox2->Text!=""){

  2. n=Convert::ToInt32(textBox1->Text);

  3. m=Convert::ToInt32(textBox2->Text);}

  4. if(checkBox1->Checked && checkBox2->Checked ){

  5. if(checkBox4->Checked){Form2::BackColor=

  6. System::Drawing::Color::Yellow; }

  7. if(checkBox5->Checked){Form2::BackColor=

  8. System::Drawing::Color::Red; }

  9. if(checkBox6->Checked){Form2::BackColor=

  10. System::Drawing::Color::Green; }

  11. for(int i=0;i if(g==0){dataGridView1->Rows->Add();} 14. for(int j=0;j

  1. dataGridView1->Columns[j]->HeaderText= (j+1).ToString()+" - ustun";

  2. dataGridView1->Rows[i]->Cells[j]->Value =a[i][j].ToString(); 17. if(a[i][j]%2==0){s+=a[i][j];} }} g+=1;

  1. MessageBox::Show("Juftlari yig'indisi= " + s.ToString()); }

  2. if(checkBox1->Checked && checkBox3->Checked ){s=0;

  3. for(int i=0;iRows->Add();}

  4. for(int j=0;j

  5. dataGridView1->Rows[i]->Cells[j]->Value ); 23. if(a[i][j]%2==0){s+=a[i][j];} } }

24. MessageBox::Show("Juftlari yig'indisi= " + s.ToString());}


3.18-rasm. 2- formaning ko‘rinishi



    1. qadam: 32 – variantdagi masalani yechish uchun 3- formada button1 ning Click hodisasiga quyidagi kodlar kiritiladi:

  1. private: System::Void button1_Click(System::Object^ sender,

  2. System::EventArgs^ e) { int g,s;

  3. #pragma endregion

  4. void index(int indexChecked[]){ int i=0;

  5. IEnumerator^ myEnum1 = checkedListBox1->

  6. CheckedIndices->GetEnumerator();

  7. while( myEnum1->MoveNext()){

  8. indexChecked[i] = *safe_cast(myEnum1->Current); i++; } }

  9. private: System::Void button1_Click(System::Object^ sender,

  10. System::EventArgs^ e) {

  11. int a[10][10]; int indexChecked[10]; s=0; int n,m;

  12. if(textBox1->Text!="" && textBox2->Text!=""){

  13. n=Convert::ToInt32(textBox1->Text);

  14. m=Convert::ToInt32(textBox2->Text);} index(indexChecked);

  15. if (indexChecked[0]==0 && indexChecked[1]==1){

  16. if (indexChecked[2]==3{

  17. Form3::BackColor=System::Drawing::Color::Yellow; }

  18. if (indexChecked[2]==4){

  19. Form3::BackColor=System::Drawing::Color::Red; }

  20. if (indexChecked[2]==5){

  21. Form3::BackColor=System::Drawing::Color::Green; }

  22. for(int i=0;iRows->Add();} 23. for(int j=0;j

  1. dataGridView1->Columns[j]->HeaderText= (j+1).ToString()+" - ustun";

  2. dataGridView1->Rows[i]->Cells[j]->Value =a[i][j].ToString(); 26. if(a[i][j]%2==0){s+=a[i][j];} }} g+=1;

  1. MessageBox::Show("Juftlari yig'indisi= " + s.ToString()); }

  2. if ( indexChecked[0]==0 && indexChecked[1]==2){

  3. if ( indexChecked[2]==3){

  4. Form3::BackColor=System::Drawing::Color::Yellow; }

  5. if ( indexChecked[2]==4){

  6. Form3::BackColor=System::Drawing::Color::Red; }

  7. if ( indexChecked[2]==5){

  8. Form3::BackColor=System::Drawing::Color::Green; } 35. s=0;

  1. for(int i=0;iRows->Add();}

  2. for(int j=0;j

  3. dataGridView1->Rows[i]->Cells[j]->Value ); 39. if(a[i][j]%2==0){s+=a[i][j];} }}

40. MessageBox::Show("Juftlari yig'indisi= " + s.ToString());}}


3.19-rasm. 3- formaning ko‘rinishi



    1. qadam: 32 – variantdagi masalani yechish uchun 4- formada quyidagi kodlar kiritiladi:

  1. int g,s;

  2. #pragma endregion

  3. private: System::Void Form31_FormClosed(System::Object^ sender,

  4. System::Windows::Forms::FormClosedEventArgs^ e) {

  5. Application::Restart(); }



button1 ning Click hodisasiga quyidagi kodlar tеriladi:

  1. private: System::Void button1_Click(System::Object^ sender,

  2. System::EventArgs^ e) {

  3. int a[10][10]; int indexChecked[10]; s=0; int n,m;

  4. if(textBox1->Text!="" && textBox2->Text!=""){

  5. n=Convert::ToInt32(textBox1->Text);

  6. m=Convert::ToInt32(textBox2->Text);}

  7. if(comboBox1->Text=="Tasodifiy sonlar bilan to'ldirish"){

  8. if(checkBox1->Checked){ if(checkBox4->Checked){

  9. Form31::BackColor=System::Drawing::Color::Yellow; }

  10. if(checkBox5->Checked){

  11. Form31::BackColor=System::Drawing::Color::Red; }

  12. if(checkBox6->Checked){

  13. Form31::BackColor=System::Drawing::Color::Green; }

  14. for(int i=0;i

  15. if(g==0){ dataGridView1->Rows->Add();}

16. for(int j=0;j

  1. dataGridView1->Columns[j]->HeaderText=

  2. (j+1).ToString()+" - ustun";

  3. dataGridView1->Rows[i]->Cells[j]->Value =a[i][j].ToString(); 20. if(a[i][j]%2==0){ s+=a[i][j];}}} g+=1;

  1. MessageBox::Show("Juftlari yig'indisi= " + s.ToString());} }

  2. if(comboBox1->Text=="DataGridWiew dan kiritish"){

  3. if(checkBox1->Checked){ if(checkBox4->Checked){

  4. Form31::BackColor=System::Drawing::Color::Yellow; }

  5. if(checkBox5->Checked){

  6. Form31::BackColor=System::Drawing::Color::Red; }

  7. if(checkBox6->Checked){

  8. Form31::BackColor=System::Drawing::Color::Green;} s=0;

  9. for(int i=0;i

  10. if(g==0){dataGridView1->Rows->Add();}

  11. for(int j=0;j

  12. a[i][j]=Convert::ToInt32( dataGridView1->Rows[i]->Cells[j]-

>Value );
33. if(a[i][j]%2==0){s+=a[i][j];} }}
34. MessageBox::Show("Juftlari yig'indisi= " + s.ToString());} }
35. }

3.20-rasm. 4- formaning ko‘rinishi
    1. TabControl va RadioButton komponеntalari



Ushbu komponеntalar boshqarishni osonlashtirish va ekranning ichki sohasidan optimal foydalanish uchun ishlatiladi. Ko‘p miqdordagi boshqariluvchi ma`lumotlarni ko‘rsatish kеrak bo‘lganda TabControl komponеntasidan foydalangan ma`qul.
Uchta TabControl komponеntalarida RadioButton tanlash komponеntalaridan foydalangan holda matn uchun bеrilgan ikki variantdan birini tanlaydigan, matn uchun rang va o‘lcham bеradigan dastur tuzish masalasi qo‘yilsin. Masalaning dastur ko‘rinishi 3.21- rasmda kеltirilgan.
Qo‘yilgan masalani yechish uchun Visual Studio 2012 dasturi ishga tushiriladi, asosiy oyna mеnyu bo‘limlaridan File->New-

Download 5,98 Mb.

Do'stlaringiz bilan baham:
1   ...   59   60   61   62   63   64   65   66   ...   134




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish