[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 in the collection at a certain index to nothing, however, when I attempt to add new indexed item the collection count goes up.
Let's say I have a collection with 2 items, item(0) and item(1), I want to be able to remove elements in item(0), and add new values in its place without increasing the collection count.
[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
how to maintian index in collection class -
Hii To all,
I have developed collection class that inherites System.Collections.CollectionBase class and used it to store objects of specific class.
This collection class is attached with array of win forms. Collection idex is mtch with winforms array index. In each form activa
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
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
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
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 Index vs every other index I can think of **Resolved ** -
Why?
Why aren't collection's indexes zero based?
I have a list of 'instances' in a combo box
The 'instances' are members of a collection.
Item 1 in the combo box has an index of 0
But.. has an index of 1 in the collection... Pants!
It would be nice to write:-
clsObjects.Item
Bit shifting in VB... -
How can I do bit shifting in VB? Is there any other way than to change value hard way to binary and then do the shifting and after all convert final value to desimal?
[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
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
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
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
Highlighted items in multi select -
Hello, I am working with a list box that has multiple selct turned on, and all that I want to know is, is there a way to get all of the highlighted indexes in an array or a collection or something. I realize that it you could do it by trapping every click event and adding or removing a
For Each Loop Problem -
I'm trying to use a For Each loop to iterate through a collection of items from a combobox and compare the value of each item in the collection to a string value to find the index of the string value in the combobox and then set another combobox's .selectedIndex to that index. But inst
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
[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?
[2008] Listbox multiselection question. (make different listboxes with the same...) -
Hi again guys,
I got 2 listboxes.
both listboxes selection mode is "Multiple - Extended"
now, when I multiselect some items on listbox1
I want the same index of the items to be selected in listbox2.
let's say I have selected items 0, 1 ,4 ,7 (Index I mean , not the text)
Removing menu items -
I have a problem that i already solved once but i can't repro. the solution
I have a menu item "mnuItem" with index 0. Then i load some more of those menu items with Load, so i have:
mnuItem(0), mnuItem(1), mnuItem(2), ...mnuItem(N)
How can i now remove all of those
Removing item from collection -
Dim b As Bookmark
If collbookmarks.Count <> 0 Then
MsgBox "Nothing to remove"
Else
Set Favs = New bkmarks
Favs.Remove Index ' whatever the index number you want removed
Collection acting weird, Item update question -
Hi,
i have seached throughout forum, but didnt find any Collection question to address my type of problem.
Elements stored in colTestCollection are reference types.
In following code, i want to loop through Collection and update properties of stored objects.
Code:
Priv
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
Listview keys -
I've read a number of posts and threads on several forums about how to work around the lack of a Key property for .NET ListViewItems, but none of them work to my satisfaction.
Under VB6, the Key was not just a convenient place to store additional data in each ListItem. It was a way
[2005] All dates between two dates -
If I have two dates, for example
1/1/2008
15/1/2008
How can I get a collection containing all dates between the two, for example in this case I need a collection containing
1/1/2008
2/1/2008
3/1/2008
4/1/2008
5/1/2008
6/1/2008
7/1/2008
8/1/2008
9/1/2008
10/1/2008
11
Collection Sorting -
Is there an easy way to sort a collection other then cloning an item and .Inserting it into the collection at the desired
position and removing the original?
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
Shifting bits -
hi there,
Shifting bits - is it possible on VB ?
cause i execut the API GetLogicalDrivers that return value is a bitmask representing the currently available disk drives. Bit position 0 (the least-significant bit) is drive A, bit position 1 is drive B, bit position 2 is drive C, an
[2008] combobox add items -
I want to add items to a combobox at runtime with text from a textbox, thats easy enough and works great until I shut the program down and restart it. How do you code user input like you would in the string collection property so its permanent. All I got is:
combobox1.items.add(tbxI
[2008] Uninstall/Re-install problem -
Ok this is weird.. I've totally Uninstalled Visual Studio from my laptop and then re-installed it, yet the error still exists from this thread. I suspect i'm not totally removing VS though because when I re-install it, all my recent projects are still listed, and toolbox items were st
Reorder collection & Listbox -
I'm trying to reorder a collection that is displayed in a listbox. I need to keep the key of the collection items the same as their corresponding listindex. THe code I'm using isn't working properly but I'm not sure what it's doing exactly. I just know it's not moving the selected i
Help! ADO SEEK and INDEX (SQL SERVER) -
I am shifting my database from access to sql serevr i am facing a problem that Index and Seek property of recordset are not supported by Provider.
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
Bad index type for collection -
Hi All,
I'm using an ActiveX control to interface to an SAP scripting API object and when I access the Rows collection using Rows(index) I can only use a constant for the index - if I use a variable of either Long or Integer type I get "Bad index type for collection access"
checkbox index -
I remember back in the day when if you had two items with the same name you were asked if you wanted to create an indexed array of the items. This way you could have multiple items(ill use checkboxes), with the same name, and then an index.
The index value made it very easy to loop
Labels collection... -
I have a prob which may be able to be solved by a collection...
Can someone give me quick runthrough on how I could create a collection of labels, and set their properties.
I would like to reference them by an Index, not a Key.
(I'm using a collection 'cause I want the Remove me
bit shifting question -
I'm still not a bit shifting pro so I gotta ask.
DWORD 0xFF000000
FF = Alpha Value = 255
How can I directly modify that byte?
Do I bitshift << 24 then set it with >> 24?
[2008] DataGridView ComboBox Cell Items -
I have a datagridview with a combobox column on it. The items are automatically added at run time, they have been entered in the collection. How can I display a value in the combobox that is not in the collection? I would like to be able to have every cell display a different value at
Rearranging Collection for Listbox -
Can anyone tell me why my app. raises an error on the last .add line of this code. I have delete moveup, movedown, movetop and this movebottom procedure and this is the only one that doesn't work. The code is very similar for the delete the only thing different is putting the selecte
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