Moving Collection Items -
I've never used a Collection before and I was wondering how would I go about moving an item from one index to another?
I want to display the item that has an index of 0 and then remove it form the collection at a certain interval. Then I want to move all teh other items up a spot in the collection. (1 becomes 0, 2 becomes 1, etc.)
Thanks in advance.
Edit: Also, is there a fast way to clear a collection other than looping through it all and setting the values to null?
Moving Collection Items -
I've never used a Collection before and I was wondering how would I go about moving an item from one index to another?
I want to display the item that has an index of 0 and then remove it form the collection at a certain interval. Then I want to move all teh other items up a spot in
enumerate collection in RichTextBox -
How do I print the items in my collection in a RichTextBox. If I try to show the items in my collection in debug.print, all the items in my collection show. So I know I have the enumeration part set up correctly. If I try to use the same process in the RichTextBox, it loops through
Maximum items in a collection -
I got a problem with the collection object in Visual Basic 6.
A maximum of 256 items can be added in a collection. But, if you pass this limit, no more item are add in collection, but the count property continue to expand.
Example:
Dim colTest As New Collection
Dim iCpt As in
UserControl property question -
I have an usercontrol with a collection of items, i can use the Forms Editor for Adding/Remove and Editing the items in the collection at design time (thanks at this forum for this).
Now i want to have a property ID wich is one of this items, and select it at design time.
I'm exp
collections help please!!! -
What exactly does a collection do?
if i set a new collection in my form
will i be about to use the collection in other forms?
what is a collection of classes are there??
can only show me basics of a collection with examples
add , remove , items etc keywords?
understanding is m
slow listbox -
I have a collection that can contain 10,000 or more items. Each of these items has a string entry summary in a listbox.
The problem that I have is that if the information in one of the collection items changes I have to update the corresponding string summary in the listbox. This me
Collection/Array -
Hello,
Please help me to solve this easy problem (easy to you but not to me).
I have this block(I, II) and name(A, AB). Their combination is 4 and put in a collection. Each item in this collection (i.e. I_A) points to few records. There're many items in each record and one of th
Error in Collection whenever delete one item from collection!!! -
Hii everybody,
I am trying to remove one of the item from the collection, any item not like first or last or in sequence. LIke i have collection of 4 items and i removed 2 second item. After that i am trying to add new with new Key value whcih for this example is 5(In sequence). The
Comparing info in a Collection -
I am currently using a collection to store data about products. I want to compare fields in 2 different collection items, and then sort by which has the greatest number in the collection item that is being compared. For example I have:
Collection Item 1 has a field names matches
[2008] Removing items from collection without shifting index -
Hi
I have an old school collection that now I need a feature where I can remove an item, however the index can not change, it is very important, so how, if it's even possible can I remove an item but somehow keep the collection from shifting indexes?
I tried setting all the elements
question about collection object -
in my this code
Dim col As New Collection
col.Add "first", "key1"
col.Add "second", "key2"
is ther any way I can get the 'key' names of all items in collection at runtime
I can get collection items values but don't know how t
[2008]Linking a collection to items displayed in a UserControl. -
I'm working on building my own UserControl that will display thumbnails. I've got the collection and the items that the collection holds working ok, and I've got a handle on how I'm going to display the information on the face of the UserControl. However, my problem is how to fire the
Collection Help -
ok I'm trying to set up a collection to store multiple properties per Item. (e.g. I want it to store partnumber, description, etc in the same collection Item) There will be multiple Items in the collection with the same info. I am trying to distingush between the different items by
Removing Items from a collection -
Can anyone give me any examples of how they would remove several items from a collection without getting a "subscript out of range " error.
I have a collection of maybe 60 items and most of them due to validation will be removed leaving me with around twenty, the thing is
Collection confusion -
I used a collection in my application, because I thought I could use a string as key for the items in the collection, but I get an error.
Am I doing something wrong, or isn't it possible to use strings as keys?
Passing VB.net collection to VB6 com dll -
Hi,
I have a VB6 COM DLL that expects a VB6 style collection object as parameter to a method.
It seems like I can not pass a VB.NET created collection.
What do I have to do? I can not make any modifications to the VB6 COM DLL.
The VB6 DLL accesses items in the collection by a
Recordset to Collection -
I have tried taking the records from a recordset and building a collection. Problem is that I close the recordset afterwards. When trying to access items in the collection, they are invalid (because the RS is closed).
How can I transfer the values of the RS rather than create poin
Max no items can be added to a collection -
After reading the help files and searching through a couple of text books, I could not find the max number if items that can be added to a collection. I have a feeling it is 256, is this correct?????
Clear Collection items ...., -
Hai ,
I have a new collection RowE , i keep adding values to the collection and perform some string comparision, addition or whatever with them all, Now when i unload the form i need to clear all the contents in the collection .
That is i want, RowE.Count shld be = 0.
How can
Moving Items Between Listboxes -
Hey...
Could someone please provide me with the syntax for moving items in between two listboxes (i.e. List1 and List2)?
I'm having some trouble fiddling about with it. I simple want to be able to add items from List1 to List2 (deleting the item from List1 in the process) and vic
Creating a new collection (clearing it) -
Hi,
If I create a collection class with a private collection variable to hold all it's child items, do I need to set each item to "Nothing" before creating a new collection? Like:
Dim errxDelete As Error
For Each errxDelete In mcolErrors
Set errxDelete = Nothing
Collection within a Collection -
I want to create a class with several instances (a collection), to hold transaction information. Say an order number, sales date, customer name, etc. Now, within that class instance, I want the items purchased on this order: Beer, cigarettes, condoms, whatever.
Plus there will be
Collections Index Problem..HELP! -
I filled a listbox and a collection with customers at the same time, when I remove an item from the listbox it will adjust the index automatically, lets say If I have 3 items and remove one, the last item's index will be = 1, but I also removed it from the collection, but the collectio
Remove an Item from a collection -
Hi there. I'd really appreciate some help on this. I am checking an arraylist for a value in a collection. If the value is not present then I want to remove the item from the collection. This is the code I am using:
'Check each item against the ArrayList - if not there then remove f
Determining if an object exists -
I am trying to write code that adds items to a collection. The problem I face is that I need to determine if an item already exists, I don't want to add it again.
Because of the number of items in the collection, I do not want to loop through them all checking each one.
Is there
[2008] Keeping track of a moving datagrid -
So, I have a datagridview that I'm moving between forms, and I was wondering if anyone knew a way I could reference that grid in a general way without specifically referring to the control collection it is in? Right now I'm declaring it in Form A, then moving it btw Forms B, C, D but
Save Items Collection in text file -
I try to storage from listbox the Items Collection in a file... but i don't have any idea how to do this. Can somebody help me.
Edit/Display/Deleting from a Collection -
Class/collection newbie questions for a homework assignment. Here we go:
1 form (textboxes to accept data and add, edit, display data in the collection)
clsMotor (with defined properties for the class)
clsMotors (collection that contains methods for saving, deleting, editing, disp
Sorting Collection Items -
As per one VBForums user's recommendation, I decided to use a collection to create an array of objects...
Now I have but one more thing that I need to know...
I have a property called "Number" that is an integer or double (doesn't matter really)...
I would like to so
my own collection -
when you create a listview, it has an items property. this returns a collection.
so you can do
for each item in myListView.Items
...
next
now, if i make a class myItemGroup which contains the class myItem and a property items() that returns an array of myItems, how can i use thi
How to find out if a collection element exists -
how would I go about figuring out if there's an item in my collection with a certain key?
My program creates collection items with keys "a##" where a is any letter and ## is a number.
now, how would check to see if key "s34" has data?
[2008] "(Collection)" listed in combobox -
I'm trying to load a stringcollection from application settings.
cbxRace.Items.Add(My.Settings.RaceString)
I keep getting (Collection) in the combobox instead of the string items.
Can someone tell me what i'm missing?
List box / Collection -
I am trying to add the string in text box to the list box. How to do it ? also trying to add the same items in one collection. how to add in collection ?
Combobox in usercontrol -
Hi,
I created a combobox within an usercontrol. I added following property :
Public ReadOnly Property Items() As ComboBox.ObjectCollection
Get
Items = Me.cboComboBox.Items
End Get
End Property
When I drop this usercontrol on a form, I s
Modifying items in a collection -
I have created a public collection to hold some strings (and associated keys) and can add and retrieve item values - but I cant modify the value of existing items in the collection.
For example - I have added a string ("Mars") to the collection using cCollection.add("
Is there a way to search part of the collection's key only -
Hi all,
I am new with the VB collection object here.
My question is this: Can I search/compare just part of the
key (not the entire word) in the collection object?
Example if I have a collection which has the followings:
col.Add "Apple Pie", "Applepie"
Fast searching in a collection -
Hello,
How do I perform a fast searching in a collection.
My collection object has over 1000 items.
Cheers.
Serialize a collection -
Hello,
I have succeeded in serializing a class of purely public strings to an XML file for use as my app. settings as a replacement for an .ini file. (Largely due to reading this forum!)
I would now like to serialize a collection of strings (for example a list of user names) usi
Key for items in a Collection -
Hi,
I have a problem.
Removing an item from a collection, and then adding a new object with a Key like the one of the deleted item, I get a message "This key is already associated with an element in this collection (error 457)".
What can I do to be able to reuse the dele
[2005] Search in a very big listview. -
Hello fellow coders, I have a problem that I like your toughts on;
I'm having a textbox where you can enter search query. I'm 'for each'ing' true a collection finding the search query, and each time it occours, the listview is filled with that particular item in the collection.