We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Changing Default Value of a property

Thread ID:

Created:

Platform:

Replies:

25278 Feb 23,2005 11:06 AM Windows Forms 0
loading
Tags: FAQ
Cheunhui Wang
Asked On February 23, 2005 11:06 AM

Most properties have a default value. I was curious if it''s posible to change tje default value during run time. I tried to Get the PropertyDescriptor from the type, then find the DefaultValueAttribute. Change this attribute by creating a new instance of DefaultValueAttribute (as the Value field is read only). However, this doesn''t do anything. The end goal is to 1. Be able to make any existing form as the default form, so that next time a new form is created, it uses the new default property set. 2. When a property grid is used on the Form, the new default values should be displayed as default (not in bold text). Any thoughts would be geat. Thanks,

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;