private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { CustomComboBoxItem ComboMaker = (CustomComboBoxItem)this.comboBox1.SelectedItem; int code = Convert.ToInt32(ComboMaker.tag.ToString()); Car1.maker = code; this.comboBox2.Items.Clear(); localhost2.modelws modelz = new localhost2.modelws(); localhost2.Maker Maker1 = new localhost2.Maker(); code = Convert.ToInt32(ComboMaker.tag.ToString()); Maker1.maker = code; localhost2.reply mm = new localhost2.reply(); try { mm = modelz.models(Maker1); //MessageBox.Show(mm.reply0); string mod_row = mm.reply0; string[] models = mod_row.Split(new string[] { "&" }, StringSplitOptions.None); int mod_num = models.Length; int i = 0; for (i = 0; i < mod_num; i++) { string[] model_data = models[i].Split(new string[] { "_" }, StringSplitOptions.None); this.comboBox2.Items.Add(new CustomComboBoxItem(model_data[0], model_data[0])); } } catch { MessageBox.Show("Failed To Load Models From www.alekz.eu/carz \n Check You Internet Connection", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
/// <remarks/> public void modelsAsync(Maker Maker) { this.modelsAsync(Maker, null); }