473,383 Members | 1,822 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,383 software developers and data experts.

ListBox . SetItemData ???

Is there anything similar to what MFC has, like CListBox::SetItemData ?

Thanks!
Nov 16 '05 #1
2 6633
In .Net Listbox, you can throw in any object, not just text. If that's the
case, you can create your own class that has an extra "Tag" property and add
objects of that class to the ListBox. Just override the ToString method to
control what you want to display in the listbox.

-vJ

"Daniel P." <da******@hotmail.comU> wrote in message
news:uM**************@TK2MSFTNGP11.phx.gbl...
Is there anything similar to what MFC has, like CListBox::SetItemData ?

Thanks!

Nov 16 '05 #2
Cool! It worked! Thanks!

"Vijaye Raji" <no*************@hotmail.com> wrote in message
news:uQ*************@TK2MSFTNGP11.phx.gbl...
In .Net Listbox, you can throw in any object, not just text. If that's the case, you can create your own class that has an extra "Tag" property and add objects of that class to the ListBox. Just override the ToString method to control what you want to display in the listbox.

-vJ

"Daniel P." <da******@hotmail.comU> wrote in message
news:uM**************@TK2MSFTNGP11.phx.gbl...
Is there anything similar to what MFC has, like CListBox::SetItemData ?

Thanks!

Nov 16 '05 #3

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

Similar topics

17
by: amber | last post by:
Hello. Can someone tell me what I may be doing wrong here? I'm using the code (lboxRP is a listbox): Dim newRPindex As Integer newRPindex = Me.lboxRP.FindString(RP)...
1
by: DavideR | last post by:
i'm using w2002 vs2002 sp2 list1.additem(...) vb6.setitemdata(list1,list1.items.count-1,...) .... = some value i recieve the following exception list1.items can't support 1 arguments what's...
3
by: Paul T. Rong | last post by:
I have a listbox (of product names) control on my form. I want to pass the selected item (a product name) to a subform, and the product unitprice should apear automatically next to the product name...
1
by: PL | last post by:
Hi all, What is the equivalent to C++ ListView methods GetItemData and SetItemData in the C# ListView component? Regards, PL
8
by: Oddball | last post by:
Ok - I have a ListBox control and I'm ready to write my own DrawItem event handler. What I want to draw as the item is another control. I have created a user control that I would like to list in...
6
by: Chris Leuty | last post by:
I am populating a multiselect Listbox from a dataset, with the content of the listbox filled by one table, and the selections determined from another table. So far, I have been keeping the dataset...
7
by: Dave | last post by:
Hi all, After unsuccessfully trying to make my own dual listbox control out of arraylists, I decided to look for a 3rd party control. I've looked for over a week now and can't find anything but...
3
by: Ali Chambers | last post by:
Hi, I have created a listbox called "dtlist1" on my VB.NET form. I call a procedure as follows: Private Sub openfile(flname As String) dtlist1.Items.Clear() etc..
1
by: Pascal | last post by:
hello i would like to upgrade this code to vbnet, i tried without success: Sub ListBoxControl(ByRef sMode As String) Dim aryListBox() As String Dim aryMain(,) As String Dim aryTemp(,) As...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.