Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
4110
Documents.Graphics.Brush enumeration
posted

I am trying to create a set of constants defined as Documents.Graphics.Brushes.Gray, .Red, .Black, etc. But am not having any luck. I thought I could define them as

Private Const BrushGray as Documents.Graphics.Brush = Documents.Graphics.Brushes.Gray

but alas, it requires an enumerated type this way. Anyone have any ideas or know what I am not seeing? I can dim it as a local variable this way in the method, but not as a global const. I really need to do it as a global constant as they are used throughout the report. Thanks.

  • 10240
    Verified Answer
    posted

    Hi dbishop9,

    You are correct. Brushes is class and what you need to satisfy the requirements of a constant is an enum.

     In this scenario you would need to create an enum from the Brushes class. You can do this by setting class properties and assigning them to enum values. Once you do this you would be able to set your constant.

    Please let me know if you have any additional questions regarding this matter.