473,774 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1653
Assuming you have embedded the icon in the current assembly:

Dim res As New
System.IO.Strea mReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )
Dim ico As System.Drawing. Icon

ico = New System.Drawing. Icon(res)
res.Close()
"Lou" <lo********@com cast.net> wrote in message
news:ei******** *****@TK2MSFTNG P09.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******@onlin e.excite.com> wrote in message
news:uw******** ******@TK2MSFTN GP15.phx.gbl...
Assuming you have embedded the icon in the current assembly:

Dim res As New
System.IO.Strea mReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )
Dim ico As System.Drawing. Icon

ico = New System.Drawing. Icon(res)
res.Close()
"Lou" <lo********@com cast.net> wrote in message
news:ei******** *****@TK2MSFTNG P09.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******@onlin e.excite.com> wrote in message
news:uw******** ******@TK2MSFTN GP15.phx.gbl...
Assuming you have embedded the icon in the current assembly:

Dim res As New
System.IO.Strea mReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )
Dim ico As System.Drawing. Icon

ico = New System.Drawing. Icon(res)
res.Close()
"Lou" <lo********@com cast.net> wrote in message
news:ei******** *****@TK2MSFTNG P09.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.BaseSt ream)

but now it crashes on
System.IO.Strea mReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )I have a resource fil in my project but how do I add it to the assembly?"Siva M" <sh******@onlin e.excite.com> wrote in messagenews:uw* *************@T K2MSFTNGP15.phx .gbl...> Assuming you have embedded the icon in the current assembly:>> Dim res As New>System.IO.S treamReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )> Dim ico As System.Drawing. Icon>> ico = New System.Drawing. Icon(res)> res.Close()>>> "Lou" <lo********@com cast.net> wrote in message> news:ei******** *****@TK2MSFTNG P09.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********@com cast.net> wrote in message
news:OZ******** ******@TK2MSFTN GP09.phx.gbl...
I changed
ico = New System.Drawing. Icon(res)

to
ico = New System.Drawing. Icon(res.BaseSt ream)

but now it crashes on
System.IO.Strea mReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )Ihave a resource fil in my project but how do I add it to the assembly?"SivaM " <sh******@onlin e.excite.com> wrote inmessagenews:u w************** @TK2MSFTNGP15.p hx.gbl...> Assuming you haveembedded the icon in the current assembly:>> Dim res AsNew>System.IO .StreamReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )> Dim ico As System.Drawing. Icon>> ico = NewSystem.Drawi ng.Icon(res)> res.Close()>>> "Lou" <lo********@com cast.net>wrote in message> news:ei******** *****@TK2MSFTNG P09.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.Argument NullException 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******@onlin e.excite.com> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
What error are you getting? Are you passing the correct resource name
(including the namespace)?

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

to
ico = New System.Drawing. Icon(res.BaseSt ream)

but now it crashes on
System.IO.Strea mReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )Ihave
a resource fil in my project but how do I add it to the assembly?"SivaM "
<sh******@onlin e.excite.com> wrote
inmessagenews:u w************** @TK2MSFTNGP15.p hx.gbl...> Assuming you
haveembedded the icon in the current assembly:>> Dim res
AsNew>System.IO .StreamReader([Assembly].GetEntryAssemb ly.GetManifestR esourceStream(" mnu_file_open") )>
Dim ico As System.Drawing. Icon>> ico = NewSystem.Drawi ng.Icon(res)>
res.Close()>>> "Lou" <lo********@com cast.net>wrote in message>
news:ei******** *****@TK2MSFTNG P09.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
1617
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
2879
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 displayed at the left of the name of the page. How do I do this? I am using Frontpage 2002, but know how to edit HTML manually. Thanks,
8
2282
by: Adrian | last post by:
How do I put an icon on a form using code? Thank you.
2
2650
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 services via email and a customized event log viewer. An additional goal is to have the service provide a visual status indicator via an icon to be located in the Taskbar status area. The NotifyIcon component appears to be a logical candidate and worked...
5
3173
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 database. Therefore the file doesnt really exist on the user's hard drive. All the file extracting techniques require that I have the actual file on the drive in order to get an icon for it. There is a workaround for this: i could create dummy files with...
13
2081
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 part of the .resx file. Its like VB6 when I could use load all my images from a resource file. Lou
3
2855
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 property. Somehow in the form's property window's Icon property has changed to new icon, but on the form it still uses the old icon. Then I tried to set Icon property to None, and it doesn't allow me to do it. I don't know why and how can I fix...
4
6556
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 completely different. I overwrote the old ico file with the new ico file and re-ran the program. I still see the old logo at run-time. I right-clicked the project-> Add Existing Item-> added the new ico file. I set the build action to Embedded...
1
3907
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 to properly serialize the System.Drawing.Icon structure to an XML file? The following code doesn't write the icon information to the xml file. private void CreateXmlFile(string filename) {
0
9454
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10264
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10106
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
10039
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
9914
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8937
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
5355
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...
2
3610
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2852
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.