|
-
Dec 28th, 2007, 05:03 PM
#1
Thread Starter
Addicted Member
-
Dec 28th, 2007, 05:06 PM
#2
Frenzied Member
Re: ComboBox Duplicate - Problem
Well think about it. You are adding those items to the combobox every time it drops down. That means every time you click it, those items are going to be re-added. You'd be better off just adding items in the constructor of the Form or in the Form_Load event. Or even in the InitializeComponent method, even though VS says not to touch it.
-
Dec 28th, 2007, 05:09 PM
#3
Re: ComboBox Duplicate - Problem
I would suggest an alternative solution: The first step of filling a combobox is emptying the combobox, unless you specifically intend to be appending to anything that is already there. Emptying the whole thing takes only one line.
My usual boring signature: Nothing
 
-
Dec 28th, 2007, 05:15 PM
#4
Lively Member
Re: ComboBox Duplicate - Problem
I agree with Fromethius that the logic to load the combobox would be better placed in something like a form load routine. If (for whatever reason) this is impractical, you should use Me.cmb_judet.Items.Clear() at the beginning of your cmb_judet_DropDown routine.
~*~*~*~*~*~*~* Wow... I was too slow   ~*~*~*~*~*~*~*
• That's the way things come clear. All of a sudden. And then you realize how obvious they've been all along.
- Madeleine L'Engle
-
Dec 28th, 2007, 05:20 PM
#5
Re: ComboBox Duplicate - Problem
 Originally Posted by tamjap
~*~*~*~*~*~*~* Wow... I was too slow    ~*~*~*~*~*~*~*
Yeah, sometimes you have to rush one out. I've been beaten to the punch many times by people who fire off a shorter answer.
My usual boring signature: Nothing
 
-
Dec 28th, 2007, 05:26 PM
#6
Thread Starter
Addicted Member
-
Dec 28th, 2007, 06:11 PM
#7
Re: ComboBox Duplicate - Problem
If the combo box will ever be changed other than on Form Load, then putting that stuff in the form load event won't solve the problem. Clearing the combo box prior to filling it will solve the problem whether it is in the load event, or anywhere else.
My usual boring signature: Nothing
 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|