By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,978 Members | 1,467 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,978 IT Pros & Developers. It's quick & easy.

Changing the value of a Attribute at run time

P: n/a
Hi,

Is it possible to conditionally change the value of the "Browsable"
attribute at the top of the property constructor at runtime in VC++.net?
For example, I would like to conditionally change the following property
(PartNumber) to display in a property grid. I can control whether it
displays by inserting either Browsable(True) or Browsable(False), but I
would like to do this programmatically based on a condition.

[Browsable(True)]
__property String* get_PartNumber()
{
return _partNumber;
}

__property void set_PartNumber(String* value)
{
_partNumber = value;
}

thanks,
Pradeep
Nov 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a


Pradeep wrote:
Hi,

Is it possible to conditionally change the value of the "Browsable"
attribute at the top of the property constructor at runtime in
VC++.net?
For example, I would like to conditionally change the following
property (PartNumber) to display in a property grid. I can control
whether it displays by inserting either Browsable(True) or
Browsable(False), but I would like to do this programmatically based
on a condition.


Not directly, but have a look to
System.ComponentModel.ICustomTypeDescriptor and friends. You should be
able to do what you want and even more. I think there is an article on
codeproject.com about that.
--
Quentin Pouplard
http://www.sf.net/projects/myoe
Nov 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.