473,801 Members | 2,466 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Assigning a "tag" to a listbox item

Dan
Is there any way to assign a tag value to each item in a listbox?
Dec 5 '05 #1
8 8765
One technique that I use is to create a new class with the overridden
"ToString" property set to return what I want to display and a Tag property.
I then add instances of this class to the listbox items collection.
--
Dennis in Houston
"Dan" wrote:
Is there any way to assign a tag value to each item in a listbox?

Dec 6 '05 #2
Hi,

I have used a hashtable for this. Use the listbox item as the key
for the data.

Ken
-----------------
"Dan" <Da*@discussion s.microsoft.com > wrote in message
news:6B******** *************** ***********@mic rosoft.com...
Is there any way to assign a tag value to each item in a listbox?

Dec 6 '05 #3
"Dan" <Da*@discussion s.microsoft.com > schrieb:
Is there any way to assign a tag value to each item in a listbox?


Just ignore the German text and look directly at the code:

<URL:http://dotnet.mvps.org/dotnet/code/controls/#ItemData>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>
Dec 6 '05 #4
What I've done is attach an ArrayList to the tag. You can then have a
one-to-one correspondence between the listbox items and the ArrayList.

"Dan" <Da*@discussion s.microsoft.com > wrote in message
news:6B******** *************** ***********@mic rosoft.com...
Is there any way to assign a tag value to each item in a listbox?

Dec 6 '05 #5
Dan
Thanks very much Herfried. Do you know of a way to get Google (or some other
service) to translate your web pages? They look quite interesting...

Dan
"Herfried K. Wagner [MVP]" wrote:
"Dan" <Da*@discussion s.microsoft.com > schrieb:
Is there any way to assign a tag value to each item in a listbox?


Just ignore the German text and look directly at the code:

<URL:http://dotnet.mvps.org/dotnet/code/controls/#ItemData>

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 6 '05 #6
Dan
Thanks all...

Dan

"Dan" wrote:
Is there any way to assign a tag value to each item in a listbox?

Dec 6 '05 #7
dgk
On Mon, 5 Dec 2005 15:37:03 -0800, Dan <Da*@discussion s.microsoft.com >
wrote:
Is there any way to assign a tag value to each item in a listbox?


Good advice by all. I miss ItemData.
Dec 6 '05 #8
"Dan" <Da*@discussion s.microsoft.com > schrieb:
Thanks very much Herfried. Do you know of a way to get Google (or some
other
service) to translate your web pages? They look quite interesting...


I feel sorry, but AFAIS Google's automatic translation service doesn't work
very well with my website. Maybe it's caused by the XHTML markup I use.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Dec 6 '05 #9

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

Similar topics

4
1999
by: Mark Erikson | last post by:
I'm currently writing an HTML editor for the PocketPC, and one of my Tag class's properties is DefaultAttributes. The idea behind this is that some tags are almost always used with certain attributes, ie <a href="">, so I'd like to make sure those attributes are included when I insert the tag. Since I actually don't write that much HTML myself, I was hoping to get some feedback as to which tag/attribute combinations are used particularly...
24
5836
by: Mohammd M. Hussain | last post by:
Hi, I am writing an XHTML 1.0 Strict Compatible web page. However, the validator complained about the <br> tag. I wonder whether there is another alternative for this. Thanks,
3
5145
by: Kiki Novak | last post by:
Hi, I'm an Austrian writer living in Montpezat (South France), and I'm currently busy converting some of my writings from LaTeX to HTML to publish them on the Internet. The novel I'm working on has two different first-person narrators, formally distinguished by the use of italics. One of them (Violetta) only appears in italics, the other one (Victor) in normal fonts. This is a formal help for the reader to distinguish the two...
2
1756
by: ramiro_b | last post by:
Folks, Any pointers on what is the meaning of the tags (SOME_TAG, and RTI_EXPORT) preceeding the class names in the following examples? class SOME_TAG MyClass { // ... };
8
10654
by: Lian | last post by:
Hi all, It is a newbie's question about html tag "img". The attributes "title" and "alt" for "img" seems having the same function. So what is the main difference between them? Can i use them at the same time and set different values? Thank you for suggestions!
0
1094
by: Michael | last post by:
After trying to load my java applet from <OBJECT> tag (rather than <APPLET> tag), it renders fine, except when you click between the DESIGN view then back to HTML view, the <PARAM NAME="ARCHIVE" VALUE="jars/myapp.jar"> line completely vanishes. Click to HTML view again, and the applet just does not load or work (as would be expected!). Re-add the vanishing line and all is well again.
1
3337
by: ScottF | last post by:
There was a problem with ASP.Net 1.1 creating/generating bad javascript on html pages that I ran into and on the KB page that I had found at the time it said that the problem was fixed in the .Net Framework 1.1 SP 1. So, I ran "NDP1.1sp1-KB867460-X86.exe" thus installing that SP and now I'm getting this very strange "A page can have only one server-side Form tag." error and am wondering if anyone knows how to fix it. The thing is, I...
3
2623
by: Jason Gogela | last post by:
Salutations, I was wondering why I get an error using the "embed" property in asp.NET when inserting Flash into my project. Though the page renders fine using it, I bothers me deeply that the use of said tag returns an error in the code view. Is there a replacement for this? I haven't been able to find anything on the subject. Macromedia says to go with the embed flow, and related forums have returned "fuggetabboutit." I was wondeing if...
5
41150
by: cfli1688 | last post by:
I have the following xsl: =============================== <xsl:for-each select="ROWSET/ROW"> <xsl:choose> <!-- previous node is blank, this is the first node --> <xsl:when test="preceding-sibling::*/FS_STFACILITYIDENTIFIER=''"> <FacilitySiteAllDetails> <FacilitySite> <FacilitySiteName> <xsl:value-of select="FS_FACILITYSITENAME"/>
0
9698
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
10523
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...
0
10298
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10277
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7594
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
6833
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
5489
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...
1
4265
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 we have to send another system
2
3785
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.