using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TP07Ex1_ConfigVehic
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {




            cboveh.Items.Add("Clio 1.2 16V 75 E6 5 portes");
            cboveh.Items.Add("Clio 1.2 16v 75 GPL 5 portes ");
            cboveh.Items.Add("Clio TCe 90 E6 5 portes ");
            cboveh.Items.Add("Clio TCe 120 EDC E6 5 portes ");
            cboveh.Items.Add("Clio dCi 90 eco² 82g E6 5 portes");
            lstopt.Items.Add("Air conditionné");
            lstopt.Items.Add("Peinture métallisée");
            lstopt.Items.Add("Jantes alliage");
            lstopt.Items.Add("Navigation Kit main libre");
            lstopt.Items.Add("Radio CD MP3");
            lstopt.Items.Add("Contrôle ESP et ASR");
            lstopt.Items.Add("Toit panoramique");
            lstopt.Items.Add("Régulateur de vitesse");
            lstopt.SelectionMode = SelectionMode.MultiSimple;

        }

        private void btnrecap_Click(object sender, EventArgs e)
        {
            int i;
            
            if (cboveh.SelectedIndex > -1)
            {
                lblrecap.Text = Convert.ToString(cboveh.SelectedItem);
                for (i = 0; i < lstopt.Items.Count; i = i + 1)
                {
                    if (lstopt.GetSelected(i) == true)
                    {
                        lblrecap.Text = lblrecap.Text + Convert.ToString(i) + Convert.ToString(lstopt.Items[i]);
                    }
                }

            }
            else
            {
                lblrecap.Text = "Aucun véhicule sélectionné";

            }
            
        }


    }
}
