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 / August 2004

Tip: Looking for answers? Try searching our database.

User Controls Property VS .resx files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tony - 30 Jul 2004 10:03 GMT
Hi all,

I have a simple question here.  I developed a user control which inhreits
from the UserControl class. I exposed an custom property and then build the
project. In another project, I added this control to a Window Form, set that
property to a value, save and build the project. Everything gone well.
However, after I close the Form and open it again, the property is reset to
the default value. I looked into the .resx file, and there is no entry for
that custom property, so I am wondering how can I save the value of the
custom property I created to the .resx file?

Thanks for answering.

Tony
J?rg Neumann - 10 Aug 2004 10:15 GMT
Set the following two attributs to the property:

[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Localizable(true)]

But when the property is a custom type, you must implement a TypeConverter
class and bind it to the property with the TypeConverter attribut.

Check also Your DefaultValue attribut. Sometimes it cause problems, when You
set it to null.

J?rg Neumann

> Hi all,
>
[quoted text clipped - 10 lines]
>
> Tony

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.