473,594 Members | 2,757 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"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 : ImageSortAscend ant
// Allow user to select the image which will be displayed for column
sorted ascendantly
[Description("Se t image (8x8) to represent ascending sorting which will
appear onto sorted column header")]
[CategoryAttribu te("Appearance" )]
[DefaultValue(nu llptr)]
property Image^ ImageSortAscend ant
{
Image^ get()
{
return m_ImageSortA;
}
void set(System::Dra wing::Image^ value)
{
m_ImageSortA = value;
if(m_ImageSortA->Height != 8 || m_ImageSortA->Width != 8)
{
MessageBox::Sho w(L"Image should be a 8 x 8 pixels", L"Incorrect
Image Size...",Messag eBoxButtons::OK ,MessageBoxIcon ::Error);
m_ImageSortA = nullptr;
}
}
}
#pragma endregion
//----------------------
thx.
Al.
Oct 21 '06 #1
1 1215
--== 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.co m>
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
9818
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 the tablerow style property to "None", the row (And embedded table) briefly disappear, but then bounce right back into sight. Any ideas on why it's doing this and how to make the style.display = "None" stick?
5
4628
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 different parameters, i get different result, but i tries to check if i set the VaryByParam to none there should be the same output for different parameters, so why does it not work?
2
1633
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 Response.redirect() back to the page, the old image is still being displayed. I need to do a refresh from the browser to get the new picture. The old and new pictures are named with the same file name.
0
1374
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 exception of: "Default credentials are not supported when the connection protection is set to None" I have set all the membership and provider configuration
2
4737
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 behind. I have set the borderStyle to none and the black lines go away, but there is still white space where the borders were. Following are my html files I am using to test it. ----------------BEGIN HTML FILE----------------
1
3483
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 DataSet or XmlDocument works perfectly... using XmlReader always fails. I always get "None" as a result. Even using XmlReaderSettings does not change anything.
3
2777
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; textbox3: LastName! Now, my report will display everyone's FirstName, MiddleName, LastName from the query. Incase someone does not have a middle-name, I need the word "None", to be displayed, on the the report? How do I go about doing this? My...
2
10152
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 style code is here : .ad_div{ border: 1px solid #ccc; display: none; z-index: 1001; width: 650px; height: 470px; position: absolute; background-color:white } .ad_iframe{ border: none; width: 649px; height: 469px } html code is here: <div...
0
7880
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8374
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8242
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6665
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5413
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3903
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1486
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.