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 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
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
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
"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 :-) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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
|
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...
|
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
|
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...
|
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...
|
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...
|
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...
|
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....
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
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,...
|
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...
|
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...
| |