473,473 Members | 2,207 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Problem creating a ListViewItem object

I am trying to create a form that will display a list of open internet
explorer windows and allow the user to choose one of them. So far I
have created an arraylist which contains all of the open internet
explorer windows. In the for() part of the code below I have tried to
create a listviewitem for each window of internet explorer open (i.e.
each element of the arraylist).

However it's not working. I don't seem to have access to IE's
properties from within the last for loop.
I had hoped that i could use something like the following

ListViewItem ("item" + i) = new ListViewItem(ar[i].LocationURL , 0);

But i cant I dont have access to LocationURL here. I have also tried
the following

ListViewItem ("item" + i) = new ListViewItem(ar[i].ie.LocationURL , 0);

Which also doesn't work. I dont even know if my ("item" +i) is correct,
I had intended for that to create a listview item called itemi, where i
is the index of the arraylist we are currently at.

Can someone please offer advice how I should get this working.

Thankyou.

Gary.


private void Form1_Load(object sender, EventArgs e)
{
ArrayList ar = new ArrayList();
foreach (InternetExplorer ie in new ShellWindows())
{
Int32 iLocation = ie.FullName.IndexOf("iexplore");
if (iLocation >= 0) ar.Add(ie);
}

for (int i = 0; i<ar.Count;i++)
{

ListViewItem ("item" + i) = new ListViewItem(ar[i] ,
0); *** not working***
}

}

Nov 29 '06 #1
0 1587

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

Similar topics

2
by: Piotr Szukalski | last post by:
Hi! I have trouble with 'Contains' method in ListViewItemCollection class - it seems like it nevers calls 'Equals' method of class inherited from ListViewItem... I've found that ListViewItem...
5
by: Richard Muller | last post by:
Hi All, As I recall from Java Swing, I could assign the widths of columns to something like a list control proportionally rather than absolutely. That is, essentially I could assign "weights"...
2
by: Max Adams | last post by:
Question about using delegates with a string paramater to return a ListViewItem object... All, I have a thread and I want this thread to post messages to the main GUI thread using a delegate....
4
by: sonu | last post by:
Hi, I have a problem regarding use of a ListviewSorter class which is used to sort the items in the listview. Basically I have a listview with three columns as "Name","Size" and...
0
by: Brian Henry | last post by:
I cant seem to remember this one... I have a list view, and im owner drawing the items, i dont want the selection to hide when it loses focus so i have hideselection = false, but when i owner draw...
2
by: Xafier | last post by:
Hi, I'm creating a control that overrides ListView and so I'm working on redrawing everything myself with some changes here and there... But I'm having a problem with drawing the text inside...
12
by: garyusenet | last post by:
I have had no replies to my previous post so perhaps I didn't write it good enough. Please excuse new thread but i wanted to break from the last thread hopefully this thread will be better. ...
13
by: deciacco | last post by:
How can I have access to the items collection of a listview control on my form from a background thread? I know I need delegates to update the listview control and I have those calls in the...
1
by: schnandr | last post by:
Hi, I have a user control which contains ListView. I copy all ListViewItems into a separate List<ListViewItemcalled unfilteredItems. I am using a BackgroundWorker to filter the ListView. When...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.