Hi,
How canIset a component property value using a defined constant by IDE?
I write a Component that expose astring property. I would like to seta property value using a defined string constant by the Visual Studio IDE.
Here the example:
public class MyComponent : Component
{
private string myProperty;
public string MyProperty
{
set{ myProperty = value;}
get{ return myProperty;}
}
}
Then I put the Component into a Form and by IDE using the Property Windows I want to setthe value:MyProperty = MY_CONSTANT
Inside the Form's InitializeComponent() method authomatically it will be a line like this
this
.myComponent.MyProperty = MY_CONSTANT;
P.s.: the defined constant is declared in a specific class.
public class MyConstants
{
public const string MY_CONSTANT = "Value";
}
Sorry for my broken english