473,394 Members | 1,811 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,394 software developers and data experts.

How to define a property as an Image data type?

I have a data model that has dozens of properties of most every data type. I
now want to declare a few of these properties as Images but can't seem to do
it.

The approach I thought would work was this one:

private Image _picture;
public Image Picture
{
get
{
return _picture;
}
set
{
_picture = value;
}
}

where I've declared "using System.Drawing" at the top of the file. But it
won't accept it. In fact, Intellisense doesn't even recognize
"System.Drawing".

Is it not possible to declare a property as an Image type?

----------------------
Robert W.
Vancouver, BC
www.mwtech.com

Nov 17 '05 #1
4 22046
It is, but you need to reference the System.Drawing assembly in your
project. By default DLL project don't reference this. Just right-click on
your project in the IDE, and select Add References, choose System.Drawing
from the list in the first tab, and away you go.

"Robert W." <Ro*****@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
I have a data model that has dozens of properties of most every data type.
I
now want to declare a few of these properties as Images but can't seem to
do
it.

The approach I thought would work was this one:

private Image _picture;
public Image Picture
{
get
{
return _picture;
}
set
{
_picture = value;
}
}

where I've declared "using System.Drawing" at the top of the file. But it
won't accept it. In fact, Intellisense doesn't even recognize
"System.Drawing".

Is it not possible to declare a property as an Image type?

----------------------
Robert W.
Vancouver, BC
www.mwtech.com

Nov 17 '05 #2
Sean,

Unbelievable, thank you! I would have never known to do this. Why
Microsoft couldn't have included some "smarts" into the Visual Studio UI to
account for it is beyond me.

If I'm ever on "Who Wants To Be A Millionaire" and there's a dotNet question
I don't know, I hope I can use you as my lifeline!!!

Thanks again,

Robert


"Sean Hederman" wrote:
It is, but you need to reference the System.Drawing assembly in your
project. By default DLL project don't reference this. Just right-click on
your project in the IDE, and select Add References, choose System.Drawing
from the list in the first tab, and away you go.

"Robert W." <Ro*****@discussions.microsoft.com> wrote in message
news:60**********************************@microsof t.com...
I have a data model that has dozens of properties of most every data type.
I
now want to declare a few of these properties as Images but can't seem to
do
it.

The approach I thought would work was this one:

private Image _picture;
public Image Picture
{
get
{
return _picture;
}
set
{
_picture = value;
}
}

where I've declared "using System.Drawing" at the top of the file. But it
won't accept it. In fact, Intellisense doesn't even recognize
"System.Drawing".

Is it not possible to declare a property as an Image type?

----------------------
Robert W.
Vancouver, BC
www.mwtech.com


Nov 17 '05 #3
Robert W. <Ro*****@discussions.microsoft.com> wrote:
Unbelievable, thank you! I would have never known to do this. Why
Microsoft couldn't have included some "smarts" into the Visual Studio UI to
account for it is beyond me.


Well, to be fair to them, the error message you should have received is
pretty clear:

"The type or namespace name 'Drawing' does not exist in the class or
namespace 'System' (are you missing an assembly reference?)"

It says what the problem is *and* a possible cause.

Note that a namespace may be contributed to by several assemblies, and
you may also want to use an assembly that VS.NET doesn't know about. I
agree that VS.NET could be better here, but I don't think it's being
particularly bad.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 17 '05 #4
"Jon Skeet [C# MVP]" <sk***@pobox.com> wrote in message
news:MP************************@msnews.microsoft.c om...
Robert W. <Ro*****@discussions.microsoft.com> wrote:
Unbelievable, thank you! I would have never known to do this. Why
Microsoft couldn't have included some "smarts" into the Visual Studio UI
to
account for it is beyond me.


Well, to be fair to them, the error message you should have received is
pretty clear:


I didn't want to say anything, he said such nice things about me :-)
Nov 17 '05 #5

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

Similar topics

1
by: prasaddevivara | last post by:
I am using the outerHTML property to modify the HTML of existin elements in a web page in Internet Explorer. But same outerHTM property is not working in firefox browser, Anybody can tell me a...
12
by: Pol Bawin | last post by:
Hi All, Did somebody already define attributes for numerical properties to define value : minima, maxima, a number of decimal, ...? This information would be useful to unify syntax Polo
0
by: MS Newsgroups | last post by:
Hi, I am trying to store a thumbnail picture in ActiveDirectory, but am having some problems with type conversions. According to the documentation the Thumbnailphoto property in the directory...
6
by: Kay | last post by:
Hi all, In vb6, I can define a custom type like this: Private Type uClient sName As String sMonday As Double sMondayHeadCnt As Integer End Type
1
by: --== Alain ==-- | last post by:
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...
0
by: --== Alain ==-- | last post by:
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...
0
by: doubts | last post by:
Hi, I have a query regarding reading Image Property for button from a XML file . I read XML files to Generate Screens using System.Windows.Forms.Controls .The XML file is read and properties...
1
by: doubts | last post by:
Hi, I have a query regarding reading Image Property for button from a XML file . I read XML files to Generate Screens using System.Windows.Forms.Controls .The XML file is read and properties...
7
by: Computer Guru | last post by:
Hi, Pardon the unclear/verbose subject, I just can't think of another way of phrasing it. Basically, I can assign the (for instance) "Location" property of a picture box to a data-bound item....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.