473,324 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

GetEnumerator method not present for ListBox.ObjectCollection

The .NET 1.1 documentation declares that there is a GetEnumerator method
associated with the ListBox.ObjectCollection class.

When I try to implement this as follows:

IEnumerator posControls = ListBox.ObjectCollection.GetEnumerator();

The autocompletion mechanism shows only two methods: Equals() and
ReferenceEquals()

Any ideas why this is occuring?
*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #1
3 2456
just tried it on my vs 2003

IEnumerator ie = lstMessage.Items.GetEnumerator();

it works correctly actually.

Nov 17 '05 #2
You mentioned that you implemented it as follows:

IEnumerator ie = lstMessage.Items.GetEnumerator();

I was implementing it directly as:

IEnumerator posControls = ListBox.ObjectCollection.GetEnumerator();

Could you provide me the code where you declare "1stMessage" and
"Items"?

Thanks muchly

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3
cud ya plz post some code and explain a little bit more about wat ya r goin
to achieve exactly.
thx
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: John C | last post by:
I'm new to C#, so just point me at the correct reference material if this question has been answered before. When creating a new class which implements the IDictionary interface, two versions of...
1
by: MikeB | last post by:
I am using GetEnumerator for determining how many ListBox controls exist on a form and then binding each of them to a datasource. This is required as I need to add more Listbox controls to the...
2
by: TPS | last post by:
I am trying to bind a listbox to my custom collection object. My object implements IEnumerable and crashes when the bind event calls myobject.GetEnumerator() I get an Invalid Cast exception in...
2
by: David Morris | last post by:
Hi I want to add multiple items (about 20) to a checked list box control at run time, but do not know how to use the AddRange method of the Items collection. Currently, I am using the Add method,...
3
by: George | last post by:
Sub ExcelToListBox() Dim xRange As Object Dim ary Dim xValue As String xRange = oXL.Range("A1:A9") 'has letters A-H ary = xRange.value xValue = ary(3, 1) 'xValue = C...
2
by: andrewcw | last post by:
This is wrong but it seems I might be on track somewhat close: I want to display my ArrayList of Random numbers in the list box. Below you see this as aLRandoms. There seems to be a provision to...
3
by: andrewcw | last post by:
Who can explain this ?? : I expect 2 but I get 4 items ! private void button1_Click(object sender, EventArgs e) { object bunchOfStuff = { "foo", "fee" }; listBox1.Items.Clear();...
16
by: colin | last post by:
Hi, is it possible to have a recursive GetEnumerator for traversing a tree structure ? public IEnumerator<DTypeGetEnumerator() { return GetEnumerator(root);
4
by: Anand Ganesh | last post by:
Hello All, I want to go through each item in a Listbox collection. How will I do this? I was looking for ListBoxItem but nothing is available? Any suggestions please? Thanks Anand Ganesh
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.