LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-01-2005, 10:05 AM   #1
mrobertson
Member
 
Registered: May 2005
Posts: 275

Rep: Reputation: 30
Putting a timestamp on a listbox item (vb.net)


Is there anyway to put a timestamp on a listbox item and if so how would this be done?
 
Old 08-01-2005, 10:14 AM   #2
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
If you are using the report view, just add a column for date/time and fill it with the contents of DateTime.Now...
 
Old 08-01-2005, 10:18 AM   #3
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
How do I set up a listbox for report view?
 
Old 08-01-2005, 10:48 AM   #4
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
You go to your little form designer, select your list box, find the view property and set that to Details.

You may want to learn how to navigate the MSDN documentation for .Net. There's a lot of good stuff there, and reading about the various methods and properties for individual classes can really help answer the simple questions.

Edit: Actually, it's the ListView class that has the different views. Switch your ListBox to a ListView and you should have the View property...

Last edited by deiussum; 08-01-2005 at 11:02 AM.
 
Old 08-01-2005, 11:56 AM   #5
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
There is not a view property for the listbox. Is there another way to set it up?
 
Old 08-01-2005, 12:00 PM   #6
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Quote:
Originally posted by mrobertson
There is not a view property for the listbox. Is there another way to set it up?
There is for the ListView which has many of the same things you are probably using in the ListBox.

If you absolutely cannot use the ListView instead, well, just append/prepend the text of the DateTime string to the ListBox items, formatted any way you want.
 
Old 08-01-2005, 12:04 PM   #7
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
The listbox does not have an append or prepend property either.
 
Old 08-01-2005, 12:13 PM   #8
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
No, no, no. Each item of the listbox is represented by a string... append or prepend the date to that string.

Code:
Dim s As String

s = "Name of Item"
s = s + " (" + DateTime.Now + ")"

'Add item to ListBox using s as the name of the item...
 
Old 08-01-2005, 12:23 PM   #9
mrobertson
Member
 
Registered: May 2005
Posts: 275

Original Poster
Rep: Reputation: 30
Ok! I understand what do do now and I got it working great. Is there anyway that could explain my other thread a bit better. I still do not understand how to define the strings that are being compared. I have a string that will be going into a text file that needs to compared with everystring already in the text file to see if they match.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Timestamp Help jch02140 Linux - Newbie 7 03-17-2006 02:33 AM
removing item from array niteshadw Programming 1 08-01-2005 06:06 PM
mozilla xpm kmenu item desktop item cjae Linux - Newbie 3 04-06-2005 07:11 AM
Need JavaScript help with Listbox lothario Programming 0 09-07-2004 03:20 AM
Unknown Item in Tray Arkas Linux - Newbie 1 08-23-2003 12:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:29 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration