Connecting Tech Pros Worldwide Forums | Help | Site Map

To remove items from a Combo Box list permanently in VB6.0

Newbie
 
Join Date: Jul 2007
Posts: 8
#1: Jul 26 '07
Hello,

How can I remove selected items from a combo box permanently from the list during run time in VB 6.0. It should not show up in the next run time.

Please help.

Thank You,
Pratibha

pureenhanoi's Avatar
Familiar Sight
 
Join Date: Mar 2007
Location: VietNam
Posts: 175
#2: Jul 26 '07

re: To remove items from a Combo Box list permanently in VB6.0


Quote:

Originally Posted by mysore

Hello,

How can I remove selected items from a combo box permanently from the list during run time in VB 6.0. It should not show up in the next run time.

Please help.

Thank You,
Pratibha

If all item from ur combobox are fix (u have been inserted from designer) so u cannot remove any items. If they are dinamic (loaded from database), simply remove from database also when u remove from combobox
Moderator
 
Join Date: Oct 2006
Location: Australia
Posts: 7,748
#3: Jul 27 '07

re: To remove items from a Combo Box list permanently in VB6.0


Quote:

Originally Posted by pureenhanoi

If all item from ur combobox are fix (u have been inserted from designer) so u cannot remove any items. If they are dinamic (loaded from database), simply remove from database also when u remove from combobox

I have to disagree, pureenhanoi. The fact that items are placed in the list at design time has no bearing. They can still be removed with the .RemoveItem method.

mysore, The real issue here is persistence of your list from one execution to the next. As usual, to do this you need to record the information somewhere, so you can read it back next time. The three places that immediately come to mind would be a text file, a database or the system registry.
Member
 
Join Date: Jul 2007
Posts: 82
#4: Jul 27 '07

re: To remove items from a Combo Box list permanently in VB6.0


Quote:

Originally Posted by Killer42

I have to disagree, pureenhanoi. The fact that items are placed in the list at design time has no bearing. They can still be removed with the .RemoveItem method.

mysore, The real issue here is persistence of your list from one execution to the next. As usual, to do this you need to record the information somewhere, so you can read it back next time. The three places that immediately come to mind would be a text file, a database or the system registry.

Hi Killer42 -

You are right at that point, that you can remove list items from the Combo box object by .RemoveItem, but the problem is, it is merely on that run / instance. I mean, after you terminate the program... it will list back all items which were loaded in the design time, which means, including the one you previously removed.
Newbie
 
Join Date: Jul 2007
Posts: 8
#5: Jul 27 '07

re: To remove items from a Combo Box list permanently in VB6.0


You are right. Whether the items added to the list in design time or run time does not matter. It will go away with the RemoveItem method only for that particular run time /instance. I guess this has to be stored in the database and removed from the database or registry.

Thanks . This makes sense.

Pratibha
debasisdas's Avatar
Moderator
 
Join Date: Dec 2006
Location: Bangalore ,India
Posts: 7,508
#6: Jul 27 '07

re: To remove items from a Combo Box list permanently in VB6.0


for that u need to store the data in the database and retrive it back around the next time u execute the same .
pureenhanoi's Avatar
Familiar Sight
 
Join Date: Mar 2007
Location: VietNam
Posts: 175
#7: Jul 27 '07

re: To remove items from a Combo Box list permanently in VB6.0


Quote:

Originally Posted by Killer42

I have to disagree, pureenhanoi. The fact that items are placed in the list at design time has no bearing. They can still be removed with the .RemoveItem method.

mysore, The real issue here is persistence of your list from one execution to the next. As usual, to do this you need to record the information somewhere, so you can read it back next time. The three places that immediately come to mind would be a text file, a database or the system registry.

i mean that, all fixed items always existing when control being loaded. It cannot be removed at runtime and continue disappear at next runtime (except you remove it again). As your mind, you inserted an item at design time and remove it at runtime, is this? Why did you must do that? Simpy dont insert it at runtime. Look at the concept. We're talking about one item is being removed at runtime and it shouldnt appear again at next runtime. My example is comparing between fixed item and dinamic item only. okey?
Reply