![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Get Form Designer To Ignore Properties Hi all, I am using Visual Studio 2005. I have a User Control with the following property [Browsable (false) ] public String MyProperty { get { return this.my_property_var; } set { this.my_property_var = value; } } When I place my User Control on a form I cannot see the property in the Property Browser (good), but default code does get generated in InitializeConponent ......////.... MyControl.MyProperty = ""; ......////.... How can I prevent this? I really ask as my properties in my live code are DateTime properties and their default values get set to the day/time the form was designed and ideally I do no want to set them to DateTime.Now in the Load method or similar. Thanks in advance. Kevin |
My System Specs![]() |
| | #2 (permalink) |
| | Re: Get Form Designer To Ignore Properties in news:3c9ac1eb-e2c5-4812-a981-c773ebaefe10@xxxxxx, k.mellor@xxxxxx wrote : Quote: > Hi all, > > I am using Visual Studio 2005. > > I have a User Control with the following property > > [Browsable (false) ] > public String MyProperty > { > get { return this.my_property_var; } > set { this.my_property_var = value; } > } > > > When I place my User Control on a form I cannot see the property in > the Property Browser (good), but default code does get generated in > InitializeConponent > > .....////.... > MyControl.MyProperty = ""; > .....////.... > > How can I prevent this? to be generated if I remember well. -- Fred foleide@xxxxxx |
My System Specs![]() |
| | #3 (permalink) |
| | Re: Get Form Designer To Ignore Properties Try this attribute: using System.ComponentModel [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] <k.mellor@xxxxxx> wrote in message news:3c9ac1eb-e2c5-4812-a981-c773ebaefe10@xxxxxx Quote: > Hi all, > > I am using Visual Studio 2005. > > I have a User Control with the following property > > [Browsable (false) ] > public String MyProperty > { > get { return this.my_property_var; } > set { this.my_property_var = value; } > } > > > When I place my User Control on a form I cannot see the property in > the Property Browser (good), but default code does get generated in > InitializeConponent > > .....////.... > MyControl.MyProperty = ""; > .....////.... > > How can I prevent this? > > I really ask as my properties in my live code are DateTime properties > and their default values get set to the day/time the form was designed > and ideally I do no want to set them to DateTime.Now in the Load > method or similar. > > Thanks in advance. > > Kevin |
My System Specs![]() |
| | #4 (permalink) |
| | Re: Get Form Designer To Ignore Properties Thank you both for your replies. [DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)] works perfectly. Kevin |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| How to access the designer class for a WPF form | .NET General | |||
| Modifying OEM properties listed in system properties | Vista installation & setup | |||
| designer | Vista General | |||
| Expression Web Designer | Vista General | |||