| | |
Display hours of day in 24 hour in listview
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Apr 2008
Posts: 115
Reputation:
Solved Threads: 6
Hi
I am trying to populate a listview with all the hours of the day in 30 minute intervals.
I can doing very basically from 0 to 24 with the following code:
but what i would like to do is have it display in 24 hour format e.g. 00:00, 00:30 ...etc
I have tried using the date.time variable but it just doesnt work.
I am trying to populate a listview with all the hours of the day in 30 minute intervals.
I can doing very basically from 0 to 24 with the following code:
VB.NET Syntax (Toggle Plain Text)
Private Sub CreateTimeStep() For i = 0 To 25 Step 0.5 lstDays.Items.Add(i) Next End Sub
but what i would like to do is have it display in 24 hour format e.g. 00:00, 00:30 ...etc
I have tried using the date.time variable but it just doesnt work.
•
•
Join Date: Dec 2002
Posts: 461
Reputation:
Solved Threads: 56
Try this:
VB.NET Syntax (Toggle Plain Text)
Dim d As Date = "00:00:00" For x As Integer = 0 To 47 ListBox1.Items.Add(d.TimeOfDay.ToString) d = d.AddMinutes(30) Next
Last edited by waynespangler; Jun 23rd, 2008 at 1:37 pm.
Wayne
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
It is hard to understand how a cemetery can raise its burial rates and blame it on the cost of living.
![]() |
Other Threads in the VB.NET Forum
- Previous Thread: Help with Sockets and text parsing!
- Next Thread: Hw 2 add Data Bindings to ComboBox
| Thread Tools | Search this Thread |
Tag cloud for VB.NET
.net .net2008 2008 access add advanced application array assignment basic beginner box browser button buttons center click client code combo convert cpu cuesent data database datagrid datagridview datetimepicker designer dissertation dissertations dissertationtopic eclipse editvb.net employees excel exists forms function html images isnumericfuntioncall lib listview map mobile module msaccess mssqlbackend mysql net number open page pan pdf picturebox picturebox2 port print printing printpreview problem record regex reuse right-to-left save search serial settings socket sorting sqldatbase sqlserver storedprocedure structures temp textbox timer timespan transparency txttoxmlconverter usercontol vb vb.net vb2008 vba vbnet vista visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winsock wpf wrapingcode xml





