I am working on a UserControl in VB.NET. I cannot get DefaltValue to
work with the Color structure. Here's the code:
<RefreshProperties(RefreshProperties.All), _
DefaultValue(GetType(Color), "SteelBlue"),
Category("Appearance")> _
Public Property BorderColor As Color
Many threads in Google Groups recommending this syntax. Many threads
stating it doesn't work. Does anyone have a working example of this?
BTW, it has to work. On the standard controls, ForeColor and BackColor
work.
bogston
bogstonkott@hotmail.com - 30 Dec 2004 02:29 GMT
Never fails. Once you post a message, you find the problem. The
previous syntax is correct. The problem is 'Serializable()'. This is
how I declared my class (mainly out of habit, I included
Serializable():
<Serializable(), _
Description("My Button Control"), _
ToolboxBitmap(GetType(Button)), _
Designer(GetType(MyButtonDesigner))> _
Public Class MyButton
I removed Serializable() and the DefaultValueAttribute started working.
bogston