M
Martin Dobson
Basically I can't figure out for the life of me how to display a custom list of colors in the property window. I have a property called ForeColor() which I want to use a custom list of colors which I have built as a structure. I mimiced the design of system.drawing.color to do this but it doesn't work. I get the following error:
"Value of type 'MBHC.WebCustCtls.Design.Color' cannot be converted to 'System.Drawing.Color'."
I am trying to build a custom typeconverter to avoid this but I seem to be going round in circles. Basically instead of showing the standard color picklist at design-time I want to show a custom list of only colors I specify. Here is my color structure, at present I am trying to display one color in the list. Once working I will want to list multiple different custom colors.
Public Structure Color
Private _DefaultColor As System.Drawing.Color
Public Shared ReadOnly Property NHSBlue() As System.Drawing.Color
Get
Return ColorTranslator.FromHtml("#0066CC")
End Get
End Property
Public Shared ReadOnly Property DefaultColor() As System.Drawing.Color
Get
Return ColorTranslator.FromHtml("#990000")
End Get
End Property
End Structure
Any suggestions?
Thanks in advance!
"Value of type 'MBHC.WebCustCtls.Design.Color' cannot be converted to 'System.Drawing.Color'."
I am trying to build a custom typeconverter to avoid this but I seem to be going round in circles. Basically instead of showing the standard color picklist at design-time I want to show a custom list of only colors I specify. Here is my color structure, at present I am trying to display one color in the list. Once working I will want to list multiple different custom colors.
Public Structure Color
Private _DefaultColor As System.Drawing.Color
Public Shared ReadOnly Property NHSBlue() As System.Drawing.Color
Get
Return ColorTranslator.FromHtml("#0066CC")
End Get
End Property
Public Shared ReadOnly Property DefaultColor() As System.Drawing.Color
Get
Return ColorTranslator.FromHtml("#990000")
End Get
End Property
End Structure
Any suggestions?
Thanks in advance!