Results 1 to 3 of 3

Thread: Enumeration

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2007
    Location
    Sweden
    Posts
    50

    Resolved Enumeration

    Hey

    Can I use enumeration in a loop? something like this:

    Code:
        Enum Days As Integer
            Monday = 1
            Tuesday = 2
            Wednesday = 3
        End Enum
    
            ' I dont want to do it like this:
            ListBox1.Items.Add(Days.Monday.ToString)
            ListBox1.Items.Add(Days.Tuesday.ToString)
            ListBox1.Items.Add(Days.Wednesday.ToString)
    
            ' But like this:
            Dim i As Integer
    
            For i = 1 To 3
                ' Here I would like to set the days by a integer to string.
                ' Something like this:
                ' ListBox1.Items.Add(Days.(i).ToString)
            Next
    Last edited by jojo116; Feb 27th, 2010 at 05:57 AM.

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