473,657 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Add object to listview

Hi!
sometime ago, a friend show me that in BC++ you could add an objet to each
element of a listview. Now I wnat to know if it is possible to do this on
VB.net 2005.
I've a collection of objects and show some of their properties on the
listview, if I could attach the object to each file of the listview it'll
be easier.
Thnaks.
bye
Jul 24 '06 #1
5 6583
XiSco,

A ListView has items (no elements), that are special objects which can hold
a lot of information.
AFAIK can a listview not hold direct whatever object.

http://msdn2.microsoft.com/en-us/lib...m_members.aspx

You can add to listviewitems again (detail) items (to show in detailview).

I hope this helps,

Cor

"XiScO" <si*******@aqui .esschreef in bericht
news:uZ******** *****@TK2MSFTNG P05.phx.gbl...
Hi!
sometime ago, a friend show me that in BC++ you could add an objet to each
element of a listview. Now I wnat to know if it is possible to do this on
VB.net 2005.
I've a collection of objects and show some of their properties on the
listview, if I could attach the object to each file of the listview it'll
be easier.
Thnaks.
bye

Jul 24 '06 #2
Thanks for the reply. I don't understand exactly what you say (english is
not my native language).
I want a listitem which conaints some string and an object (not shown).
Particulary I add computers to the listview, so i show computer name, ip
and mac. I create an object with this data, wich has public methods to make
ping, wakeonlan, etc.
So I want the object as a member of the the listview so when a click is done
in one listview element I call the objet.method.
Is clear what I want to do?
Thanks again.
Cor Ligthert [MVP] wrote:
XiSco,

A ListView has items (no elements), that are special objects which can
hold a lot of information.
AFAIK can a listview not hold direct whatever object.

http://msdn2.microsoft.com/en-us/lib...m_members.aspx
>
You can add to listviewitems again (detail) items (to show in detailview).

I hope this helps,

Cor

"XiScO" <si*******@aqui .esschreef in bericht
news:uZ******** *****@TK2MSFTNG P05.phx.gbl...
>Hi!
sometime ago, a friend show me that in BC++ you could add an objet to
each element of a listview. Now I wnat to know if it is possible to do
this on VB.net 2005.
I've a collection of objects and show some of their properties on the
listview, if I could attach the object to each file of the listview it'll
be easier.
Thnaks.
bye
Jul 24 '06 #3
Xisco,

Simple than, no that is impossible,

Cor

"XiScO" <si*******@aqui .esschreef in bericht
news:eb******** *****@TK2MSFTNG P02.phx.gbl...
Thanks for the reply. I don't understand exactly what you say (english is
not my native language).
I want a listitem which conaints some string and an object (not shown).
Particulary I add computers to the listview, so i show computer name, ip
and mac. I create an object with this data, wich has public methods to
make
ping, wakeonlan, etc.
So I want the object as a member of the the listview so when a click is
done
in one listview element I call the objet.method.
Is clear what I want to do?
Thanks again.
Cor Ligthert [MVP] wrote:
>XiSco,

A ListView has items (no elements), that are special objects which can
hold a lot of information.
AFAIK can a listview not hold direct whatever object.

http://msdn2.microsoft.com/en-us/lib...m_members.aspx
>>
You can add to listviewitems again (detail) items (to show in
detailview).

I hope this helps,

Cor

"XiScO" <si*******@aqui .esschreef in bericht
news:uZ******* ******@TK2MSFTN GP05.phx.gbl...
>>Hi!
sometime ago, a friend show me that in BC++ you could add an objet to
each element of a listview. Now I wnat to know if it is possible to do
this on VB.net 2005.
I've a collection of objects and show some of their properties on the
listview, if I could attach the object to each file of the listview
it'll
be easier.
Thnaks.
bye

Jul 24 '06 #4
You can use the ListViewItem.Ta g property to store private data that should
be associated with a particular item

/claes

"XiScO" <si*******@aqui .eswrote in message
news:uZ******** *****@TK2MSFTNG P05.phx.gbl...
Hi!
sometime ago, a friend show me that in BC++ you could add an objet to each
element of a listview. Now I wnat to know if it is possible to do this on
VB.net 2005.
I've a collection of objects and show some of their properties on the
listview, if I could attach the object to each file of the listview it'll
be easier.
Thnaks.
bye

Jul 24 '06 #5
Ok, thanks
Cor Ligthert [MVP] wrote:
Xisco,

Simple than, no that is impossible,

Cor

"XiScO" <si*******@aqui .esschreef in bericht
news:eb******** *****@TK2MSFTNG P02.phx.gbl...
>Thanks for the reply. I don't understand exactly what you say (english is
not my native language).
I want a listitem which conaints some string and an object (not shown).
Particulary I add computers to the listview, so i show computer name, ip
and mac. I create an object with this data, wich has public methods to
make
ping, wakeonlan, etc.
So I want the object as a member of the the listview so when a click is
done
in one listview element I call the objet.method.
Is clear what I want to do?
Thanks again.
Cor Ligthert [MVP] wrote:
>>XiSco,

A ListView has items (no elements), that are special objects which can
hold a lot of information.
AFAIK can a listview not hold direct whatever object.

http://msdn2.microsoft.com/en-us/lib...m_members.aspx
>>>
You can add to listviewitems again (detail) items (to show in
detailview) .

I hope this helps,

Cor

"XiScO" <si*******@aqui .esschreef in bericht
news:uZ****** *******@TK2MSFT NGP05.phx.gbl.. .
Hi!
sometime ago, a friend show me that in BC++ you could add an objet to
each element of a listview. Now I wnat to know if it is possible to do
this on VB.net 2005.
I've a collection of objects and show some of their properties on the
listview, if I could attach the object to each file of the listview
it'll
be easier.
Thnaks.
bye
Jul 26 '06 #6

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

Similar topics

1
5957
by: Welie | last post by:
Hi all- I am using a listview (MSComctlLib.ListViewCtrl.2)on an Access form. Actually there are six listviews on the form. I need to do the same thing to all six forms so I have the loop below. I would like to assign each control to a listview object, however I get a type mismatch. Further investigation reveals that the type of the control is "Custom Control" and not a listview. I would like to be able to work with real control object's...
1
1272
by: Richard Lewis Haggard | last post by:
I have a form. The form owns a listview control and an object that is acting as a remoting server. I'd like to display information as it is received by the server in the listview control that is owned by the server object's owning form. I know how I'd do this in VC++6 and MFC but I'm trying very hard to keep with the accepted C#.NET practices.What are the C#.NET standard methods to do this? =========== "I just got a new car for my wife....
0
2174
by: Sam Barham | last post by:
I have a ListView control, for which I have overwritten the WndProc method to gain access to the WM_PAINT message and generate my own OnPaint and OnPaintBackground messages, in order to colour the columns of the listview to my liking. When a row of the listview is selected, some controls are displayed on that row of the listview (so sort of like a property list thingy). In order to get the controls (specifically buttons) to display how I...
3
1122
by: tmaster | last post by:
Can I pass a listview to another form using a property definition like this? Public Class frmToDoDetail Inherits System.Windows.Forms.Form Private m_lvwTD As ListView Public Property lvwTD() As ListView Get lvwTD = m_lvwTD
1
1364
by: John Rugo | last post by:
Hi All, I would like to know how to set an object from a string provided? Here is the situation: I have a listview that holds the names of ListView Objects on different forms. I want to set an object called frmOBJ As Object to the Listview sub Item holding the name of the form and listview to access. LV is the listview holding the names of the ListViews and their Form Names
1
2059
by: polocar | last post by:
Hi, I'm using Visual C# 2005 (part of Visual Studio 2005 Professional Edition), and I have the following problem: I populate a ListView object with several items, and at the end of this process I put a statement that orders the ListView by a certain column and in a certain order (ascending or descending, it doesn't matter). To do that, I have defined a derived class of the IComparer class (as explained in the Visual Studio MSDN Library)....
1
2667
by: a | last post by:
Hi I would like to add some additional custom features to the listview, like cell editing. The created object will be added to the form as part of the GUI, and it should be able to handle events. I will create a class which conains the listview. Should I inherit this class from any existing class? If yes, which class should I inherit from? Or, should I just inherit my class from listview and add my add my additional features?
2
2353
by: Andy B | last post by:
I have the following listView control on a page: <asp:ListView ID="ListView1" runat="server" ItemPlaceholderID="PlaceHolder1"> <ItemTemplate> <dl> <dt>
1
1594
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
I'm running VS2008 & attempting to solve a problem I've encountered while developing some software for our business. Here's the basic idea...I've created a class that represents a file (with members such as file name, file location, and a string containing the files data). Each file object also contains an ArrayList of another custom object I've created--a field object (which is basically two fields--field name & field data). These...
0
8385
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8303
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
6162
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4150
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.