We help IT Professionals succeed at work.

vb.net combo.items.add times 00:00 - 23:30

DumbAssUK
DumbAssUK asked
on
354 Views
Last Modified: 2010-04-23
HI all

im trying to add a list of times into a combo using a for loop.
from 00:00 hrs - 23:30hrs
id like to do this in a for loop incrementing the time by 30mins,instead of doing it as below.

e.g

        ComboBox1.Items.Add("00:00")
        ComboBox1.Items.Add("00:30")
        ......... etc etc
        ComboBox1.Items.Add("23:00")
        ComboBox1.Items.Add("23:30")
Comment
Watch Question

       Dim t As DateTime = #1/1/1900#
        Do While t < #1/2/1900#
            ComboBox1.Items.Add(t.ToString("HH:mm"))
            t = t.AddMinutes(30)
        Loop
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.