473,830 Members | 1,868 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can hashtable hold a picture image?

Code sample:
dim hash as Hashtable 'Declare Hashtable
....
hash.add (picOne.image, "picture") 'Error here
picOne is a picturebox added to the form at design time with a GIF image
applied.

When the add method executes I get the following error:

An unhandled exception of type 'System.NullRef erenceException ' occurred in
HashTable test.exe

Additional information: Object reference not set to an instance of an
object.

Can a hashtable be used to hold picture images?

Thanks!
Nov 20 '05 #1
2 1717
* "Noozer" <po********@127 .0.0.1> scripsit:
dim hash as Hashtable 'Declare Hashtable
Replace the line above with 'Dim hash As New Hashtable()'.
Additional information: Object reference not set to an instance of an
object.

Can a hashtable be used to hold picture images?


Yes, it can hold references to images.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

"Herfried K. Wagner [MVP]" <hi************ ***@gmx.at> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
* "Noozer" <po********@127 .0.0.1> scripsit:
dim hash as Hashtable 'Declare Hashtable


Replace the line above with 'Dim hash As New Hashtable()'.
Additional information: Object reference not set to an instance of an
object.

Can a hashtable be used to hold picture images?


Yes, it can hold references to images.


Thanks... I should use the "intelli" part of "intellisen se" a bit more... I
had the object and the key swapped in my code. Ooops.
Nov 20 '05 #3

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

Similar topics

10
9515
by: Chris Coho, Jr. | last post by:
Ok, I'll explain the whole problem because there may be several ways to solve this and hopefully someone knows one. What I'm doing is creating a specialty template editor, similar to say a corel draw (but for specific uses). What I need to be able to do is import graphics and text and then move them around the background until they are where I want them and then export it out as an image file. The problem is that I need to be able to...
3
13895
by: shine | last post by:
I am trying to add an integer array to a hashtable. While adding to hashtable I want to check the duplicates in array, the way I want to do is add the key(the integer stored in array) if a duplicate key is being added then the program should return the integer else it should return -1. Here is the piece of code I have written does the logic looks ok ? ------------------------------------------------------------------ class...
6
9497
by: John Ortt | last post by:
Hi there everyone, I have a part info form which has a faded image of our company logo as a background. I want to replace the faded image with a bright red warning image on items which have run out of purchasing cover. I am nearly there, the only problem is that the code below only changes the image background for text and combo-box backgrounds, it doesn't apply it to the whole form.
6
21707
by: Andrew Robinson | last post by:
given a Hashtable and an Index, how do I retrieve the key? Hashtable h = new Hashtable(); h.Add("red", 3); h.Add("blue", 99); h.Add("green", 33); how do I get the key at index 2? h.Keys should equal "green".
0
3535
by: mnmnm1951 | last post by:
I am working with Sharepoint Services and am trying to add the fileversion Metadata to the Versions.aspx page using the example from the SDK. I have not done much with hashtables but it all looks straightforward in the SDK. The code segment added is below. The commented out lines (<!-- )are for testing and work correctly. i.e. I can create a NEW hashtable, add items to it, and display them on the Versions.aspx page. When I try to...
2
2584
by: D. Shane Fowlkes | last post by:
I've been reading up on Arrays in ASP.NET. I'm going to create an two dimensional array of some type to contain 5 columns but a variable amount of rows. I read up on the ArrayList function and the HashTable as well. In the two books I have, there's no mention of the limitations of an ArrayList and it can only contain a single column array. But from the examples, I've seen, this seems to be true. The HashTable, as far as I can tell, can...
0
899
by: Oney | last post by:
For globalization I want to hold data in Sql server and as hashtable in the cache.So I created a table (LanguageId,Key,Value) in sql server. I don't want to pull strings all the time the page is requested, instead I want to hold these data in HashTable in Cache.But hash table accepts only object-value pairs. I have to create more than one HashTable and make releation between them By the way, I don't want to create a HashTable for each...
4
12859
by: NASAdude | last post by:
I'm working on distributing a database using VS Tools for Office, and am having trouble with linked images on forms/reports. The image objects have a default path\file set on the .Picture property, which becomes invalid when the user installs the database (ie: c:\devpath\ becomes c:\program files\mydbapp, but the .Picture property still points to c:\devpath\) The problem is that I don't *know* what installation path the user will select,...
10
8515
by: chrisben | last post by:
Hi, Here is the scenario. I have a list of IDs and there are multiple threads trying to add/remove/read from this list. I can do in C# 1. create Hashtable hList = Hashtable.Synchronized(new Hashtable()); 2. create ArrayList aList = ArrayList.Synchronized(new ArrayList()); 3. create a string sList = ""; For 1 and 2, since the list is synced, many threads can directly
0
9777
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10473
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...
1
10518
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9307
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...
0
6939
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
5614
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5772
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3954
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3070
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.