Results 1 to 2 of 2

Thread: populating a combobox

  1. #1

    Thread Starter
    Lively Member flog3941's Avatar
    Join Date
    Nov 2002
    Posts
    123

    populating a combobox

    This is a kinda funny question!!

    Its not ajoke either!

    Anybody have a cute and easy way to populate a combobox witha date representing the date for firday for the next 3 years?

  2. #2
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    I came up with an ugly one here, could probably be done better....

    Code:
    Dim i As Integer
    Dim d As Date = Now.Date
    For i = 0 To 1100
        If d.AddDays(i).DayOfWeek.ToString = "Friday" Then
            ComboBox1.Items.Add(d.AddDays(i).ToShortDateString)
        End If
    Next

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width