Month wise return colors in dot net

Month wise return colors in dot net

Example:


Try this function.

 Public Function loginColor()
        Dim Scolor As Color = Nothing
        Dim IWC As Integer = Format(Now(), "MM")
        If IWC = 1 Then
            Scolor = Color.AntiqueWhite 
        ElseIf IWC = 2 Then
            Scolor = Color.Beige 
        ElseIf IWC = 3 Then
            Scolor = Color.AliceBlue
        ElseIf IWC = 4 Then
            Scolor = Color.LightCyan
        ElseIf IWC = 5 Then
            Scolor = Color.PapayaWhip 
        ElseIf IWC = 6 Then
            Scolor = Color.Snow
        ElseIf IWC = 7 Then
            Scolor = Color.LavenderBlush 
        ElseIf IWC = 8 Then
            Scolor = Color.Gainsboro 
        ElseIf IWC = 9 Then
            Scolor = Color.FloralWhite
        ElseIf IWC = 10 Then
            Scolor = Color.Honeydew 
        ElseIf IWC = 11 Then
            Scolor = Color.Ivory
        ElseIf IWC = 12 Then
            Scolor = Color.LightSlateGray 
        Else
            Scolor = Color.Bisque 
        End If

        Return Scolor
    End Function

Get Return Values Example:
Me.backcolor= loginColor()


Post a Comment

0 Comments