Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I have a custom control with a public color property that I'd like to set the defaultvalue attribute for but as color is an object it cannot be used as a defaultvalue. Is there a way to specify a color as a constant? Is there another way to set the defaultvalue attribute of a color public property?

 

Here is my code (I've highlighted the problem):

 

'
  <Description("The color used to display the sort icon in the control."), _
   Category("Appearance"), _
   Localizable(True), _
   DefaultValue([u][color=red]Color.Blue[/color][/u])> _
  Property IconColor() As Color

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Posted
Thanks. It has accepted that but it doesn't seem to work. The properties for the control show IconColor in bold indicating a non-default value even when it is Blue. I have just noticed that it is also doing this with the other properties that I have added so the devaultvalue attribute is not having any effect. The other property types are ContentAlignment and a public custom enumeration.

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Posted

Thanks very much. I done a similar thing with the other properties too and they're working now also.

 

:D

TT

(*_*)

 

There are 10 types of people in this world;

those that understand binary and those that don't.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...