DefaultValueAttribute

  • Thread starter Thread starter --== Alain ==--
  • Start date Start date
A

--== Alain ==--

Hi,

I would like to define the default value of my property.
My property is from type Bitmap^, therefore i was thinking to do :

[DefaultValueAttribute(nullptr)]

but i does not work.
how is it possible to define this property to no pointer ?

thx.

ALain
 
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 ?
thanks,

Al.
 
--== Alain ==-- said:
Hi,

I would like to define the default value of my property.
My property is from type Bitmap^, therefore i was thinking to do :

[DefaultValueAttribute(nullptr)]

but i does not work.
how is it possible to define this property to no pointer ?

Please don't multipost.

Already answered in microsoft.public.dotnet.framework.

-cd
 
Back
Top