473,397 Members | 2,068 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,397 software developers and data experts.

system drawing image cannot be converted...

Hi,
I am having an image list with a set of icons i want to use in my
application.

when using
Me.control.Icon = iconList.Images(1)
i get the error message

Value of type 'System.Drawing.Image' cannot be converted to
'System.Drawing.Icon'.

How can I use the icon list ?

Thanks for any help
Alex

Nov 20 '05 #1
3 7049
Hi Alex,

This was given as a solution to this question a while back but I don't
know whether it works.

Dim bmpIcon As Bitmap = CType (iconList.Images(0), Bitmap)
Me.control.Icon = Icon.FromHandle (bmpIcon.GetHicon)

Regards,
Fergus

Nov 20 '05 #2
Fergus,
thanks, tried it out but does not seem to work. hmmm
Alex

Fergus Cooney wrote:
Hi Alex,

This was given as a solution to this question a while back but I don't
know whether it works.

Dim bmpIcon As Bitmap = CType (iconList.Images(0), Bitmap)
Me.control.Icon = Icon.FromHandle (bmpIcon.GetHicon)

Regards,
Fergus


Nov 20 '05 #3
* "Fergus Cooney" <fi*****@post.com> scripsit:
This was given as a solution to this question a while back but I don't
know whether it works.

Dim bmpIcon As Bitmap = CType (iconList.Images(0), Bitmap)
Me.control.Icon = Icon.FromHandle (bmpIcon.GetHicon)


It works but the quality of the icon may be bad.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #4

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

Similar topics

7
by: Toby Mathews | last post by:
Hi, In an ASP.Net application I want to convert open create a FileStream object from a System.Drawing.Image - is this possible? I create an instance of an Image object using the FromFile method,...
2
by: James Coburn's Grey Helmet Hair | last post by:
When I try to compile my GTK# app, the compiler says: jbailo@linux:~/mono> mcs buttons.cs -r gtk-sharp.dll -r glib-sharp.dll -r -o buttons.exe error CS2001: Source file 'buttons.exe' could not...
3
by: Scott | last post by:
Hello, I am running into a problem with my code and can't seem to figure out the solution. I know it has to do with the pciture box control and unloading the image inthe picture box but I can't...
5
by: benoit | last post by:
Hi, I have this question. When I use the FileUpload WebControl to post an Image (= SourceFile) that I want to resize and write to the server, I keep getting this situation. If that SourceFile...
11
by: darrel | last post by:
I'm modyfying an image upload and resizing script that we've had laying around for a long while. I'm getting a NullReferenceException error (see full error at bottom) from this line: Dim g...
5
by: Jerry J | last post by:
I want to use the System.Drawing.Image class. According to the help file, this is an abstract base class. Because it is supposedly abstract, I created another class that inherits from it. However,...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
9
by: Eric | last post by:
Hi Everyone, I'm writing a UserControl that exposes a property of the type System.Drawing.Image, like this: Public Property DefaultImage() As Image Get Return propDefaultImage End Get...
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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,...
0
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...

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.