Advertisement
rakoczyn

Untitled

Jan 16th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9.  
  10. namespace Projekt_RW
  11. {
  12.     public partial class Form1 : Form
  13.     {
  14.         public Form1()
  15.         {
  16.             InitializeComponent();
  17.         }
  18.  
  19.         private void label3_Click(object sender, EventArgs e)
  20.         {
  21.  
  22.         }
  23.  
  24.         private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) // typ
  25.         {
  26.             if ((string)comboBox1.SelectedItem == "ubrania dolne")
  27.             {
  28.                 comboBox2.Enabled = true; comboBox2.SelectedItem = null;   // rozmiar
  29.                 comboBox3.Enabled = true; comboBox3.DataSource = new List<string>() { "spódnica","spodnie", "buty" }; comboBox3.SelectedItem = null;  // rodzaj
  30.                 comboBox4.Enabled = true;   // kolor
  31.                 comboBox5.Enabled = true;   // materiał
  32.                 comboBox6.Enabled = false;   // długość rękawa
  33.                 comboBox7.Enabled = false;   // sposób zakładania
  34.                 comboBox8.Enabled = false;   // rodzaj dekoltu
  35.                 comboBox9.Enabled = false;   // ilość guzików
  36.                 comboBox10.Enabled = true;  // stan
  37.                 comboBox11.Enabled = false;  // długość nogawki
  38.                 comboBox12.Enabled = false;  // sezon
  39.                 comboBox13.Enabled = false;  // wysokość
  40.             }
  41.  
  42.             if ((string)comboBox1.SelectedItem == "ubrania górne")
  43.             {
  44.                 comboBox2.Enabled = true;   // rozmiar
  45.                 comboBox3.Enabled = true; comboBox3.DataSource = new List<string>() { "marynarka", "bluzka", "sweter" }; comboBox3.SelectedItem = null;  // rodzaj
  46.                 comboBox4.Enabled = true;   // kolor
  47.                 comboBox5.Enabled = true;   // materiał
  48.                 comboBox6.Enabled = true;   // długość rękawa
  49.                 //comboBox7.Enabled = true;   // sposób zakładania
  50.                 //comboBox8.Enabled = true;   // rodzaj dekoltu
  51.                 //comboBox9.Enabled = true;   // ilość guzików
  52.                 comboBox10.Enabled = true;  // stan
  53.                 comboBox11.Enabled = false;  // długość nogawki
  54.                 comboBox12.Enabled = false;  // sezon
  55.                 comboBox13.Enabled = false;  // wysokość
  56.             }
  57.         }
  58.  
  59.         private void comboBox3_SelectedIndexChanged(object sender, EventArgs e)
  60.         {
  61.             if ((string)comboBox3.SelectedItem == "buty")
  62.             {
  63.                 comboBox2.DataSource = new List<int>() { 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45 };
  64.                 comboBox2.SelectedItem = null;
  65.                 comboBox12.Enabled = true;
  66.                 comboBox13.Enabled = true;
  67.             }
  68.             else
  69.             {
  70.                 comboBox2.DataSource = new List<int>() { 32, 34, 36, 38, 40, 42, 44, 46 };
  71.                 comboBox2.SelectedItem = null;
  72.                 comboBox12.Enabled = false;
  73.                 comboBox13.Enabled = false;
  74.             }
  75.  
  76.  
  77.             if ((string)comboBox3.SelectedItem == "spodnie")
  78.                 comboBox11.Enabled = true;
  79.             else
  80.                 comboBox11.Enabled = false;
  81.  
  82.             if ((string)comboBox3.SelectedItem == "marynarka")
  83.                 comboBox9.Enabled = true;
  84.             else
  85.                 comboBox9.Enabled = false;
  86.  
  87.             if ((string)comboBox3.SelectedItem == "sweter")
  88.             {
  89.                 comboBox7.Enabled = true;
  90.                 comboBox8.Enabled = true;
  91.             }
  92.             else
  93.             {
  94.                 comboBox7.Enabled = false;
  95.                 comboBox8.Enabled = false;
  96.             }
  97.  
  98.             if ((string)comboBox3.SelectedItem == "bluzka")
  99.                 comboBox8.Enabled = true;
  100.             else
  101.                 comboBox8.Enabled = false;
  102.  
  103.         }
  104.     }
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement