Results 1 to 3 of 3

Thread: [RESOLVED] The type System.Drawing.Color cannot be declared const

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Resolved [RESOLVED] The type System.Drawing.Color cannot be declared const

    Hello All,

    is there any way to declare const to Color?

    Code:
    public const Color ID_COLOR_INCOMING = Color.PaleGreen;
    public const Color ID_COLOR_ANSWERED = Color.Lime;
    public const Color ID_COLOR_OUTGOING= Color.Blue;
    the above codes give me warnings:

    The type System.Drawing.Color cannot be declared const

    please advise

    Thanks & Regards
    Winan

  2. #2
    Cumbrian Milk's Avatar
    Join Date
    Jan 2007
    Location
    0xDEADBEEF
    Posts
    2,448

    Re: The type System.Drawing.Color cannot be declared const

    you could use static readonly instead.
    Code:
            public static readonly Color ID_COLOR_INCOMING = Color.PaleGreen;
            public static readonly Color ID_COLOR_ANSWERED = Color.Lime;
            public static readonly Color ID_COLOR_OUTGOING = Color.Blue;
    W o t . S i g

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2003
    Posts
    784

    Re: The type System.Drawing.Color cannot be declared const

    noted and thanks!

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