473,383 Members | 1,822 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

"none" for a property

Hi,

I've seen that on all component it is possible to have (none) as value
for a property.
Usually i see it for Image or ImageList property type.

So tried it on my component. I can set the image without problem, but i
can not clear the property if i do not want to use it...
to clean the property, i mean by that, to not allocate an image data to
it... so it should display (none) as value.

what could be the problem ?

here is my part of code :
#pragma region public Property : ImageSortAscendant
// Allow user to select the image which will be displayed for column
sorted ascendantly
[Description("Set image (8x8) to represent ascending sorting which will
appear onto sorted column header")]
[CategoryAttribute("Appearance")]
[DefaultValue(nullptr)]
property Image^ ImageSortAscendant
{
Image^ get()
{
return m_ImageSortA;
}
void set(System::Drawing::Image^ value)
{
m_ImageSortA = value;
if(m_ImageSortA->Height != 8 || m_ImageSortA->Width != 8)
{
MessageBox::Show(L"Image should be a 8 x 8 pixels", L"Incorrect
Image Size...",MessageBoxButtons::OK,MessageBoxIcon::Err or);
m_ImageSortA = nullptr;
}
}
}
#pragma endregion
//----------------------
thx.
Al.
Oct 21 '06 #1
1 1202
--== Alain ==-- <no****@noemail.comwrote:
I've seen that on all component it is possible to have (none) as value
for a property.
Usually i see it for Image or ImageList property type.

So tried it on my component. I can set the image without problem, but i
can not clear the property if i do not want to use it...
to clean the property, i mean by that, to not allocate an image data to
it... so it should display (none) as value.

what could be the problem ?
When you do:
m_ImageSortA = value;
if(m_ImageSortA->Height != 8 || m_ImageSortA->Width != 8)
it's dereferencing the null reference you've passed in. You need to
check for nullity instead, doing whatever you need to do if null has
been passed in.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Oct 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sue | last post by:
Help! I have an asp table with an embedded table. The asp tablerow that contains this table has a static ID assigned of "FilterRow2" (see snippets of code below). When I click on the button to set...
5
by: z. f. | last post by:
sorry about the previous post, by mistake not completed. i have an asp.net page with the line <%@ OutputCache Duration="30" VaryByParam="none" %> but when i make requests to the page with...
2
by: YeeCN | last post by:
Hi, I have a page which contain a image control for displaying a .gif file. The application allows the user to upload a different image to replace the existing one - but when I do...
0
by: E | last post by:
I am trying to authenticate against ADAM and not use SSL. I am using connectionProtection="None" in my web.config - membership - providers -- element configuration. When I do this. I get an...
2
by: spifster | last post by:
Hello all, I am building a collapsable tree using Javascript with DOM in IE. In order to make collapsed cells disappear I have been hiding the text. The cells collapse but still leave borders...
1
by: Franck | last post by:
Hi, I'm quit confused with the following problem: I'm tryin to read an Embedded Xml file from my Class Library using a static method which should returns a XmlReader. The point is that using...
3
by: Kappucino XL | last post by:
Hi there... What is the VBA Code for inserting the string "none", in every blank textbox, in a report? My system, generates a report from a query. eg: textbox1: FirstName ; textbox2: Middle Name;...
2
by: shunia | last post by:
I try to use the display style property to show and hide a div.but it doesn't work in IE,FF and Chrome works fine.And there are no bugs in other js code and the text page in the codes below. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.