0
Reply

items to a custom combobox from an XML file and to display the progress of this in a progressbar

emmett.miller

emmett.miller

Feb 2 2005 9:58 PM
1.4k
I'm trying to add items to a custom combobox from an XML file and to display the progress of this in a progressbar but don't know what else to do. The program seems to wait for the combobox items are fully added before resuming the progress bar. This means that the progress bar only shows when the combobox has finished adding items not while it is adding items. Can you help me please? Code below:: private void loadComboBoxes() { const string EXPRESSION1 = "//row[not(Specialty = preceding-sibling::row/Specialty)]/Specialty"; const string EXPRESSION2 = "//row[not(Last_x0020_Name = preceding-sibling::row/Last_x0020_Name)]/Last_x0020_Name"; XPathDocument doc1 = new XPathDocument(fileName); XPathNavigator nav1 = doc1.CreateNavigator(); XPathNodeIterator it1 = nav1.Select(EXPRESSION1); XPathNodeIterator it2 = nav1.Select(EXPRESSION2); while (it1.MoveNext()) //this.timer1.Enabled = true; //this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Elapsed); this.axComboPlus1.AddItem(it1.Current.Value, it1.CurrentPosition); while (it2.MoveNext()) this.axComboPlus2.AddItem(it2.Current.Value, it2.CurrentPosition); } private void button3_Click(object sender, System.EventArgs e) { this.loadComboBoxes(); } private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e) { this.userControl11.Value++; }