I am again trying to figure out something that I think should be simple, but it is not working like I expect it to work. I want to add a property to my control:
private System.Int16 _DecimalPlaces;
[
Description("Indicates the number of decimal places to display."),
DefaultValue(0)
]
public System.Int16 DecimalPlaces
{
get
{
return _DecimalPlaces;
}
set
{
_DecimalPlaces = value;
}
}
Pretty straight forward right.
Now I expect to be able to right-click on that propperty in the propperty sheet and be able to select
Reset and the propperty will go back to 0 or at very worst
0. But insted I am presented with a msgbox stating that:
Cannot widen from target type to primitive type.So I scratch my head and think to myself I have done this before, but that time it was for a boolean property so I create a temp boolean property to test my theory:
private System.Boolean _DecimalP;
[
Description("Indicates the number of decimal places to display."),
DefaultValue(false)
]
public System.Boolean DecimalP
{
get
{
return _DecimalP;
}
set
{
_DecimalP = value;
}
}
And as I expected the boolean property works as expected with regards to the reset feature. It also works for type System.Double , but number is displayed
bold even after reset to default value.
What am I missing? Does the error message mean anything to anybody?
Any information (related to the problem at hand) would be appreciated.
Thanks,
Einar
Semper ubi sub ubi.