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

Get a icon from resourse file

Lou
How do i get an icon from a resourse file
Dim IC As New Icon(Icon, "mnu_file_open")

That doesn't work?
Nov 21 '05 #1
6 1637
Assuming you have embedded the icon in the current assembly:

Dim res As New
System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))
Dim ico As System.Drawing.Icon

ico = New System.Drawing.Icon(res)
res.Close()
"Lou" <lo********@comcast.net> wrote in message
news:ei*************@TK2MSFTNGP09.phx.gbl...
How do i get an icon from a resourse file
Dim IC As New Icon(Icon, "mnu_file_open")

That doesn't work?

Nov 21 '05 #2
Lou
That doesn't work
"Overload failed" for
ico = New System.Drawing.Icon(res)

"Siva M" <sh******@online.excite.com> wrote in message
news:uw**************@TK2MSFTNGP15.phx.gbl...
Assuming you have embedded the icon in the current assembly:

Dim res As New
System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))
Dim ico As System.Drawing.Icon

ico = New System.Drawing.Icon(res)
res.Close()
"Lou" <lo********@comcast.net> wrote in message
news:ei*************@TK2MSFTNGP09.phx.gbl...
How do i get an icon from a resourse file
Dim IC As New Icon(Icon, "mnu_file_open")

That doesn't work?

Nov 21 '05 #3
Lou
Overload function failed.
StreamReader cannot be converted to stream.

"Siva M" <sh******@online.excite.com> wrote in message
news:uw**************@TK2MSFTNGP15.phx.gbl...
Assuming you have embedded the icon in the current assembly:

Dim res As New
System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))
Dim ico As System.Drawing.Icon

ico = New System.Drawing.Icon(res)
res.Close()
"Lou" <lo********@comcast.net> wrote in message
news:ei*************@TK2MSFTNGP09.phx.gbl...
How do i get an icon from a resourse file
Dim IC As New Icon(Icon, "mnu_file_open")

That doesn't work?

Nov 21 '05 #4
Lou
I changed
ico = New System.Drawing.Icon(res)

to
ico = New System.Drawing.Icon(res.BaseStream)

but now it crashes on
System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))I have a resource fil in my project but how do I add it to the assembly?"Siva M" <sh******@online.excite.com> wrote in messagenews:uw**************@TK2MSFTNGP15.phx.gbl. ..> Assuming you have embedded the icon in the current assembly:>> Dim res As New>System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))> Dim ico As System.Drawing.Icon>> ico = New System.Drawing.Icon(res)> res.Close()>>> "Lou" <lo********@comcast.net> wrote in message> news:ei*************@TK2MSFTNGP09.phx.gbl...> How do i get an icon from a resourse file> Dim IC As New Icon(Icon, "mnu_file_open")>>>> That doesn't work?>>>

Nov 21 '05 #5
What error are you getting? Are you passing the correct resource name
(including the namespace)?

"Lou" <lo********@comcast.net> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
I changed
ico = New System.Drawing.Icon(res)

to
ico = New System.Drawing.Icon(res.BaseStream)

but now it crashes on
System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))Ihave a resource fil in my project but how do I add it to the assembly?"SivaM" <sh******@online.excite.com> wrote inmessagenews:uw**************@TK2MSFTNGP15.phx.gb l...> Assuming you haveembedded the icon in the current assembly:>> Dim res AsNew>System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))> Dim ico As System.Drawing.Icon>> ico = NewSystem.Drawing.Icon(res)> res.Close()>>> "Lou" <lo********@comcast.net>wrote in message> news:ei*************@TK2MSFTNGP09.phx.gbl...> How do i getan icon from a resourse file> Dim IC As New Icon(Icon, "mnu_file_open")>>>>That doesn't work?>>>

Nov 21 '05 #6
Lou
System.ArgumentNullException im mscorlib.dll

The name of my resourse file is SC.rs
How does the function know that?
I am confused as how this should work?
When you say "Embedded icon in my assembly" what do you mean. I know I have
a .res file with an icon in it.

-Louie
"Siva M" <sh******@online.excite.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
What error are you getting? Are you passing the correct resource name
(including the namespace)?

"Lou" <lo********@comcast.net> wrote in message
news:OZ**************@TK2MSFTNGP09.phx.gbl...
I changed
ico = New System.Drawing.Icon(res)

to
ico = New System.Drawing.Icon(res.BaseStream)

but now it crashes on
System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))Ihave
a resource fil in my project but how do I add it to the assembly?"SivaM"
<sh******@online.excite.com> wrote
inmessagenews:uw**************@TK2MSFTNGP15.phx.gb l...> Assuming you
haveembedded the icon in the current assembly:>> Dim res
AsNew>System.IO.StreamReader([Assembly].GetEntryAssembly.GetManifestResourceStream("mnu_f ile_open"))>
Dim ico As System.Drawing.Icon>> ico = NewSystem.Drawing.Icon(res)>
res.Close()>>> "Lou" <lo********@comcast.net>wrote in message>
news:ei*************@TK2MSFTNGP09.phx.gbl...> How do i getan icon from a
resourse file> Dim IC As New Icon(Icon, "mnu_file_open")>>>>That doesn't
work?>>>

Nov 21 '05 #7

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

Similar topics

1
by: morteza hamzehi | last post by:
i want a good resourse for to learn replication in sql 2000 inoder to practical learn and implemetion replicat
8
by: Ed Isenberg | last post by:
I notice that a lot of Web pages have an icon that is displayed preceding the URL in the place in the browser where the URL is displayed. When I bookmark or add this to Favorites the icon is also...
8
by: Adrian | last post by:
How do I put an icon on a form using code? Thank you.
2
by: Randall Powell | last post by:
I am in the process of developing a Windows Service which will: (1) monitor multiple network shares; (2) marshal text file transfers into an SQL Server 2000 instance; and (3) provide messaging...
5
by: IcingDeath via DotNetMonster.com | last post by:
I am building this SQL Server database app in which i can store files. In order to display files I want to have the app show the associated icon for the extension of the file that is in the...
13
by: Lou | last post by:
if I add a new item (Solution Items) to my project and its an icon(.ico), how can I reference that file when I am coding, Do I have to also add it to an image control, I don't want the file to be...
3
by: Nina | last post by:
Hi there, I assigned icon for a window's form using form's Icon property at design time. Now I want to change the icon. I tried to replace the old icon with the new icon using form's Icon...
4
by: randy1200 | last post by:
I have a Windows application that previously had the company logo "MyCompany.ico" added to the upper left-most corner. The company has since issued a new version of "MyCompany.ico" that looks...
1
by: =?Utf-8?B?U3RldmVU?= | last post by:
I have a structure that contains both 32x32 and 16x16 icons plus some text. I want to write all this to an XML file so that I can recover the icons later in an application. Can someone tell me how...
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
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: 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
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
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
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...
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,...

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.