Compare Enum element using logic operator : Enum « Data Type « VB.Net Tutorial

Home
VB.Net Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statements
5.Date Time
6.Class Module
7.Development
8.Collections
9.Generics
10.Attributes
11.Event
12.LINQ
13.Stream File
14.GUI
15.GUI Applications
16.Windows Presentation Foundation
17.2D Graphics
18.I18N Internationlization
19.Reflection
20.Regular Expressions
21.Security
22.Socket Network
23.Thread
24.Windows
25.XML
26.Database ADO.net
27.Design Patterns
VB.Net
VB.Net by API
VB.Net Tutorial » Data Type » Enum 
2.20.10.Compare Enum element using logic operator
Public Enum workDays
        Saturday
        Sunday = 0
        Monday
        Tuesday
        Wednesday
        Thursday
        Friday
        invalid = -1
    End Enum

        
Public Class Tester
    Public Shared Sub Main
        Dim MyDay As WorkDays
        MyDay = WorkDays.Saturday
        If MyDay < workDays.FriDay Then
            Console.WriteLine("It's the weekend.Invalid work day!")
        End If
    End Sub
End Class
It's the weekend.Invalid work day!
2.20.Enum
2.20.1.Define Enum and assign value
2.20.2.Define and use Enum as Integer
2.20.3.Declare Enum variable
2.20.4.Public Enum type
2.20.5.Assign value to Enum elements
2.20.6.Assign value to only one Enum element
2.20.7.Cast Integer to Enum value
2.20.8.Convert Enum to Integer
2.20.9.Enum value duplication
2.20.10.Compare Enum element using logic operator
2.20.11.Converting an enumerated value to a string.
2.20.12.Standard Enumeration Format Specifiers
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.