ucasesoftware,
In addition to the other comments, I would simply create a type that has
readonly properties or fields of type Color.
Something like:
Public NotInheritable Class UIColors
Private Sub New()
End Sub
Public Shared ReadOnly Category1 As Color = Color.FromArgb(255, 128,
128)
Public Shared ReadOnly Category2 As Color = Color.FromArgb(255, 192,
128)
Public Shared ReadOnly Category3 As Color = Color.FromArgb(255, 255,
128)
Public Shared ReadOnly Category4 As Color = Color.LightGreen
Public Shared ReadOnly Category5 As Color = Color.LightBlue
Public Shared ReadOnly Category6 As Color = Color.CornflowerBlue
Public Shared ReadOnly Category7 As Color = Color.HotPink
Public Shared ReadOnly Category8 As Color = Color.FromArgb(231, 231,
214)
Public Shared ReadOnly Category9 As Color = Color.Plum
Public Shared ReadOnly Category10 As Color = Color.Peru
End Class
The "NotInheritable" prevents others from inheriting from UIColors, the
"Private Sub New" prevents others from instantiating UIColors, while "Class"
requires others to qualify the usage of the members. The "Shared" allows you
to use the values without instantiating the class, while the "ReadOnly"
prevents others from assigning a value to the field (effectively making it a
constant value).
Then to use each member you simply use the value.
Me.BackColor = UIColors.Category1
Me.ForeColor = UIColors.Category6
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
| In my planning i have 10 colors will never change (one by category)
|
| 255;128;128
| 255;192;128
| 255;255;128
| LightGreen
| LightBlue
| CornflowerBlue
| HotPink
| 231; 231; 214
| Plum
| Peru
|
|
| What is the best way to use them in my class ?
| property ? array ? ennum ?
|