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 / Design Time / January 2005

Tip: Looking for answers? Try searching our database.

DefaultValue Property and Inheritance

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
joeycalisay - 26 Oct 2004 06:23 GMT
I had this thought regarding defaultvalue attribute for properties of
controls and form inheritance.

For example, I have this boolean property for a control with a supplied
defaultvalue attribute of TRUE.  What if this particular control is declared
as protected in a base form?  Down the hierarchy, the said property is
altered(set to false, then true, whatever).  If on a child form, its value
is supposed to be TRUE, it wouldn't be serialized, therefore it will mess up
the said form if its immediate parent form's setting for this property is
FALSE.   Any views?
Frank Hileman - 26 Oct 2004 15:34 GMT
Yes, this is a problem in the current serialization setup. We had a
discussion with Brian Pepin I believe in this newsgroup at one point
concerning this issue. You may find it via google; perhaps "Pepin" and
"ShouldSerialize". The only solution is to record the correct "default"
values after the base class is constructed, and use those as defaults. I
don't think it will be fixed as it is difficult in the general sense.

Regards,
Frank Hileman

check out VG.net: www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor

> I had this thought regarding defaultvalue attribute for properties of
> controls and form inheritance.
[quoted text clipped - 6 lines]
> the said form if its immediate parent form's setting for this property is
> FALSE.   Any views?
joeycalisay - 27 Oct 2004 02:40 GMT
Thanks Frank...

> Yes, this is a problem in the current serialization setup. We had a
> discussion with Brian Pepin I believe in this newsgroup at one point
[quoted text clipped - 22 lines]
> > the said form if its immediate parent form's setting for this property is
> > FALSE.   Any views?
joeycalisay - 27 Oct 2004 05:55 GMT
Am new to newsgroups, is there a way that I can have access to attachments
of archived messages?
I would like to look at the addin from related post years ago...

> Yes, this is a problem in the current serialization setup. We had a
> discussion with Brian Pepin I believe in this newsgroup at one point
[quoted text clipped - 22 lines]
> > the said form if its immediate parent form's setting for this property is
> > FALSE.   Any views?
Frank Hileman - 27 Oct 2004 17:56 GMT
You have to ask. They are not archived anywhere as far as I know. Remind me
and maybe I can dig it up...

Frank

> Am new to newsgroups, is there a way that I can have access to attachments
> of archived messages?
> I would like to look at the addin from related post years ago...
joeycalisay - 19 Jan 2005 06:03 GMT
I've tried this issue once again and was surprised that VS stores the
value of the setting of the immediate base class to be its default
(somewhat comparing the property values for the current component
against the value of an instance of its immediate base class).  The
DefaultValue set at the top of the inheritance tree will not be its
default value down the hierarchy.

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.