Hi Alain,
but when i try to compile, i have the following error :
..\RAF_ListView.h(177) : error C3115:
'System::ComponentModel::DefaultPropertyAttribute' : this attribute is not
allowed on 'RAF_ListView::AR_ListView::ImageSortAscendant'
how could it be possible ?
I searched MSDN for C3115 - I think you are misusing the attribute.
Attribute Usage on MSDN:
http://windowssdk.msdn.microsoft.com.../0b34zz73.aspx
Apparently your example is not the correct way to declare public properties so
that they can use managed attributes. In the link I posted above there is no
reference to public properties at all so I'm not sure how you can accomplish
that (although there is mention of attributes on methods, which I believe is
the direction you'll probably need to go)
Your idea that C# is similar enough to C++ and asking your questions in this
newsgroup isn't going to help you solve your problems. You're probably much
better off finding some managed C++ resources and taking some time to read
them.
if i understood well, [DefaultValue(null)] was available on .net v1 only.
DefaultValueAttribute is still alive and well in the 2.0 framework. I use it
all the time.
--
Dave Sexton
"--== Alain ==--" <no****@noemail.comwrote in message
news:ey****************@TK2MSFTNGP03.phx.gbl...
here is my code :
#pragma region public Property : ImageSortAscendant
// Allow user to select the image which will be displayed for column sorted
ascendantly
[System::ComponentModel::DefaultPropertyAttribute (nullptr)]
property Bitmap^ ImageSortAscendant
{
Bitmap^ get()
{
return m_ImageSortA;
}
void set(System::Drawing::Bitmap^ value)
{
m_ImageSortA = value;
}
}
#pragma endregion
but when i try to compile, i have the following error :
..\RAF_ListView.h(177) : error C3115:
'System::ComponentModel::DefaultPropertyAttribute' : this attribute is not
allowed on 'RAF_ListView::AR_ListView::ImageSortAscendant'
how could it be possible ?
if i understood well, [DefaultValue(null)] was available on .net v1 only.
thanks,
Al.
Dave Sexton wrote:
>Hi Alain,
Assuming you're using VS 2005 add the following to your property (C#):
[DefaultValue(null)]
public Bitmap MyBitmap { get { return bitmap } set { bitmap = value; } }
In the property window you can select the text and press the delete key or
you can right-mouse click and select "Reset".