Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm Controls / December 2004

Tip: Looking for answers? Try searching our database.

DefaultValueAttribute and Color

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bogstonkott@hotmail.com - 30 Dec 2004 00:49 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.