o
k
q
u
e
s
t
i
o
n
s
.
c
o
m

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 activate event i used one method to get current index of item in my object collection.

When i remove one of the object from list object it will change index of all otehr items automatically. Suppose you remove item at index "0", after removing item at index "1" will become one.

how to get index of item when winform get activated? Because index in collection class is changed.

Please provide any example or link that i can refer. I am trying like anything.

Thanks lot.

HDave

 

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


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


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


[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


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


Struggle with collections -
Is it possible to know on what index you are in your collection? I work with VB6 but because I'm a straight object oriƫntated [Edited by MartinLiss]I work with classes (yeah right). So I've got a collection of this class. Problem is on a certain moment I want to change the data of one


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"


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


Collection object and Keys -
OK, I have a collection object, which contains many objects of the same type. Each has a key, which is equal to the PK_ID + "K". I am implementing batch processing in my DCOM tier. Now, if I have added a few objects then they won't have a Key since they have not been stored i


Confusing Collection Question -
I have a MDI form and in it I have child forms. When create the child form, I place them in a collection - Code: Set Systemfrm = New fSystemfrm Systems.Add Systemfrm Inside the child form, I have code that needs to know collection index of itself (Me) Ho


Displaying the "Key" in a Collection -
Using VB6 Pro, Win XP Pro. I have no trouble displaying the "Item" in a Collection using either the for each next loop or just a straight for loop that uses the index of the Collection. Is there a way to display the "Key" in a Collection? Thanks in advance for any h


Is there a collection that works like a Dictionary [resolved] -
Hey Guys, I saw somewhere on MSDN that there is a collection that works much like an array and a dictonary combined. Now I can't seem to find it anymore. Does anyone know what namespace this type of collection is. What it needs to do is have the ability of going through the collect


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


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


*** are all these files in the htdocs directory -
index.html.ca index.html.cz index.html.de index.html.dk index.html.ee index.html.el index.html.en index.html.es index.html.fr index.html.he.iso8859-8 index.html.it index.html.ja.jis index.html.kr.iso-kr index.html.lu index.html.nl index.html.nn index.html.no index.html


Assigning from One Collection to Another -
This seems like it should work ... the class and initial collection assignment do ... it's when I try to assign something from one collection to another that it fails ... ***** Public Class myClass public mc_X as Integer public mc_Y as Integer ETC Public Sub New()


VB Collection help -
I need to compare wether a collection item at index (n) is = nothing...for validation purposes. If myColl.Item(n) = Nothing Then except that this gives me an error...I can't seem to find enough specifc material on collections being compared to nulls to find out if that index e


[2.0] make -1 index give null instead of out of bounds. -
I have a list and I was wondering if when you select a negative index it could give a null element instead of index out of bounds. I want to do something like belove Code: for ( int i = -1; i < 10;i++) { if (collection[i] == null) { //Will trigger once from -1 idx } } Is it


Easy Form Question -
I know I can refer to an item in the forms collection in the following way: Forms(index) But can I refer to a form in the following way: Forms("FormName") ? If not is there a property of a form which gives its index in the forms collection? Surely I won't


For Loop.. HELP! Arrgghh!! -
Hi.. I have this property : Public Property Get NewEnum() As IUnknown 'this property allows you to enumerate 'this collection with the For...Each syntax Set NewEnum = mCol.[_NewEnum] End Property I am trying to use it to go through my collection of objects. mCo


Referencing Different Instances within the Class -
What are the different Ways you Can reference an instance from within the Class itself ? I know I can Create A public Collection..mmm.. or maybe even a shared Collection and reference them by index. But Is there another way??


Sorting collection [resolved] -
I have a collection of classes which I routinely access through a for each...next loop. My problem is that this loops through each object sorted by index, and I need to sort them by key. Is there a way to do this?


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


index is associated wiht a value in a collecion -
How do i check if a index is associated wiht a value in a collecion?, before adding a value to the collection? I tred the this way but did not work ! If valColl.Item(c.Index) <> " " Then valColl.Add cc.Text, CStr(cc.Index)


Get class from collection and display information -
I have a colPeople Collection and a clsPerson class, the clsPerson class stores the following information about an object, Title, Firstname and Surname, i need to retrieve a selected object and display the information, displaying it in a message box will do. I know how to get the se


adding a collection to an arraylist collection -
for instance, i have a people class and a people collection. i would like to create a phone collection which consists of phone class and phone collection and then attach this to the people class object. so, in effect, i can call each people item and have the phone collection


Opening a form with an incrementing name in code -
Hi! I created a menu that should open different forms depending on which menu in the menu collection (name: mnuForm) is clicked. Something like below Private Sub mnuForm_Click(Index As Integer) Dim frm As Form frm.Name = "Form" & CStr(Index) frm.Show


Collection or Array for speed -
I have a class called stock that holds last_price, symbol, high, and low (for now). I have a collection of stock named stocks that is index by symbol. The collection stocks contains app. 1300 instances of obj stock. I have an event that triggers when the last price on any of t


document index from Word ActiveDocument -
Is there a faster way to get the ActiveDocuments (i) index than to loop through the documents collection?


return a collection from a fucntion -
Hi I have a command button when clikced goes to a class module function, which get a collection of all mails in my Inbox. I need to return the collectoin to myform and be able to access the collection. How do i do it????? When i do the processin in same Sub it works fine. But when


Finding The Current Reocrd -
I have seen some messages related to this issue, but none quite answers my question. Maybe I'm applying old ways of thinking to new ways of doing things??? I have a disconnected dataset, and I display each record, one at a time, full screen. I have a public counter (wish there was


Collections, classes and New() -
I have a "master" collection and a temporary collection, each is based on a class that I defined. The "master" collection exists as a private form variable. The temporary collection exists in a sub on that form. In the sub I set my temporary collection equal to t


Buttons collection -
Which, if any, of the following are properties that you can use to reference a particular Button object in Buttons collection of a Toolbar control? a. Number b. Value c. Key d. Index


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


Validation TextBox in Loop (Collection) A still no solved -
Hi Again, the same problem, a still no solved. Already I have the procedure however I will want to use to all TextBoxes in my app using to this collection. Code: Option Explicit Private Sub Text1_KeyPress(Index As Integer, KeyAscii As Integer) Text1(


mapping 1:N relationship with Classes -
I have two tables: TASK ----- ID [Int PK UNN] Description [VarChar(200) NN] Start [Date NN] End [Date] SUBTASK --------- Task [Int PFK NN] Index [SmallInt PK NN] Performer [VarChar(100) NN] As you can see a TASK can have 1 or more SUBTASKs; each subtask is identified


Dynamically copy a frame and its controls -
I have a frame as a control array, Frame1 w/index=0 and there are controls on that also as arrays, e.g. Text1, Label1, etc. all with indexes=0. And I want to dynamically make a copy of that frame along with all its contained controls, each with index=1 now. I've tried looping th


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


How to get values from session objects -
I ahve a collection object saved in the session I have also declared a new collection object When I do the following(written from memory ) dim newcoll as new collection newcoll = Cast(Session("Collection"), Collection) I get only a reference to the session colle


Java - Two Collections. The same elements or have no elements in common -
Two methods are needed in this case. Code: boolean containsAll(Collection<?> c) boolean disjoint(Collection<?>c1 Collection<?>c2) Since [i]containsAll(Collection<?> c)[i] is defined within the Collection interface all concrete implementations will be abl