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

Getting an icon for a window out of a resource.

UJ
I have an icon file stored as part of a program as a resource (Embedded
Resource). How can I get the file out of the resource to be able to set a
window's icon to the icon?

(I know the icon is there because I can pull it out as bit map and display
it.)

TIA - Jeff.
Mar 20 '06 #1
3 1297
In .net 2.0..

class myForm : Form {
void InitializeComponent() {
Icon = Resources.MyIcon;
}

}

Mar 20 '06 #2
UJ
I'm in 1.1. Thanks anyway.

"Andy" <aj*****@alum.rit.edu> wrote in message
news:11**********************@v46g2000cwv.googlegr oups.com...
In .net 2.0..

class myForm : Form {
void InitializeComponent() {
Icon = Resources.MyIcon;
}

}

Mar 20 '06 #3
Lookup the Assembly class; it has a method for getting resources.

Mar 21 '06 #4

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

Similar topics

11
by: Grant Edwards | last post by:
I'm trying in vain to set the icon for the executable generated by py2exe. According to various sources there are two answers: 1) Do it on the command line: python setup.py py2exe --icon...
3
by: Kendall Gifford | last post by:
Greetings. While trying to get a simple app working, I've been forced to delve into embedded and/or linked resources a bit. I read all the reference for the System.Resources namespace as well as...
2
by: Jack | last post by:
I was learning Windows programming in C# using Charles Petzold book, but this book was written for the older version of .NET. The example of using icon from embedded resource fails to work when...
1
by: Brian Henry | last post by:
I have an icon in my app as an embeded resource.. i am accessing it through the assemblies getmainfestresourcestream method of the assembly. The icon has a 32x32 and a 16x16 icon in the same icon...
5
by: Gidi | last post by:
Hi, I want to add icon to my form (on the left corner of the form, where the fom text is), but i can't use the property window. how can i do it through the code? my Icon path now is d:\temp....
6
by: farseer | last post by:
Hi, I created a new resouce ("app.resx") in my project and added an icon to this resource with name "IL_ICON". I would like to use this resource in some unmanaged code, in particular, with the...
1
by: hansolox1 | last post by:
The following program simply sets the icon of a form called form1. When I get the name of the embedded icon using GetManifestResourceNames(), I store the name in a string variable called s. The...
4
by: Neo | last post by:
I am developing a GUI for a destop application in Visual C++ .Net 2005, I am trying to create toolbar exactlly same as windows explorer which will have default windows icons, which are in windows...
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...
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...
0
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...
0
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,...
0
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...
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,...
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.