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 / .NET Framework / New Users / March 2006

Tip: Looking for answers? Try searching our database.

Problem with IDE when overriding Text property

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jason Barnett - 28 Feb 2006 16:03 GMT
I noticed when overriding the Text property of the
System.Windows.Forms.UserControl that the Form.Designer file does not
reflect changes made via the property browser.  In other words, when you
override the Text property and then try to change it's value at design-time,
the value is not serialized and therefore not available at run-time.

This problem does not appear to be language specific; I've reproduced it in
C# and in VB.  Here are examples of what I've written:

In VB:
   <System.ComponentModel.Browsable(True)> _
   Public Overrides Property Text() As String
       Get
           Return lblTitle.Text
       End Get
       Set(ByVal value As String)
           lblTitle.Text = value
       End Set
   End Property

In C#:
       [System.ComponentModel.Browsable(true)]
       public override string Text
       {
           get { return lblTitle.Text; }
           set { lblTitle.Text = value; }
       }

Can anyone explain to me what is happening and how I might correct the
problem?
Tim Wilson - 28 Feb 2006 21:57 GMT
You'll need to add some more attributes. See the example at the link below.
http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/msg/e308
9235cb94cfe5?hl=en


Signature

Tim Wilson
.NET Compact Framework MVP

> I noticed when overriding the Text property of the
> System.Windows.Forms.UserControl that the Form.Designer file does not
[quoted text clipped - 26 lines]
> Can anyone explain to me what is happening and how I might correct the
> problem?
Jason Barnett - 01 Mar 2006 19:56 GMT
Thanks!  That really helps.

> You'll need to add some more attributes. See the example at the link
> below.
[quoted text clipped - 32 lines]
>> Can anyone explain to me what is happening and how I might correct the
>> problem?

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.