473,386 Members | 1,785 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,386 software developers and data experts.

How to add icons into resource file

Dear all,

I am developing a project using VB.NET. I would like to
add icons in the resource file like VB6 to use with my
buttons. But I can't find how to add resource file in
VB.NET and how to retrieve from it. Please give me a
guide how to do this.

Thanks,
Kyaw Soe Lin
Jul 19 '05 #1
3 9857
You won't get a *.res file as in vb6.
Add YourIcon.Ico to YourProject as existing Item.
Set Build Action Property to Embedded Resource.
Use as follows (VB.Net example):

Imports System.Reflection.Assembly

Dim MyIco as New
Icon(GetExecutingAssembly.GetManifestResourceStrea m("YourProject.YourIcon.Ic
o"))
"Kyaw Soe Lin" <ky********@yomabank.com.mm> wrote in message
news:08****************************@phx.gbl...
Dear all,

I am developing a project using VB.NET. I would like to
add icons in the resource file like VB6 to use with my
buttons. But I can't find how to add resource file in
VB.NET and how to retrieve from it. Please give me a
guide how to do this.

Thanks,
Kyaw Soe Lin

Jul 19 '05 #2
Mick

I am interested in the solution to this also. Is it possible to use res
protocol (res://) to reference the icons when they are added this way?

Charles
"Mick Doherty" <md*******@nospam.ntlworld.com> wrote in message
news:eT**************@tk2msftngp13.phx.gbl...
You won't get a *.res file as in vb6.
Add YourIcon.Ico to YourProject as existing Item.
Set Build Action Property to Embedded Resource.
Use as follows (VB.Net example):

Imports System.Reflection.Assembly

Dim MyIco as New
Icon(GetExecutingAssembly.GetManifestResourceStrea m("YourProject.YourIcon.Ic o"))
"Kyaw Soe Lin" <ky********@yomabank.com.mm> wrote in message
news:08****************************@phx.gbl...
Dear all,

I am developing a project using VB.NET. I would like to
add icons in the resource file like VB6 to use with my
buttons. But I can't find how to add resource file in
VB.NET and how to retrieve from it. Please give me a
guide how to do this.

Thanks,
Kyaw Soe Lin


Jul 19 '05 #3
As far as I can ascertain you must use a standard win32res file to use that
protocol. Although in my previous post I said that you could not add *.res
files, it turns out that you can. You need to add it by manually compiling
with vbc.exe using the /Win32Resource switch. I have never used vbc manually
and have no idea how to reference those resources, but Iwould assume you
must use the ResourceReader Class, maybe someone else could enlighten us.

"Charles Law" <la****@btinternet.com> wrote in message
news:ea**************@TK2MSFTNGP11.phx.gbl...
Mick

I am interested in the solution to this also. Is it possible to use res
protocol (res://) to reference the icons when they are added this way?

Charles
"Mick Doherty" <md*******@nospam.ntlworld.com> wrote in message
news:eT**************@tk2msftngp13.phx.gbl...
You won't get a *.res file as in vb6.
Add YourIcon.Ico to YourProject as existing Item.
Set Build Action Property to Embedded Resource.
Use as follows (VB.Net example):

Imports System.Reflection.Assembly

Dim MyIco as New

Icon(GetExecutingAssembly.GetManifestResourceStrea m("YourProject.YourIcon.Ic
o"))
"Kyaw Soe Lin" <ky********@yomabank.com.mm> wrote in message
news:08****************************@phx.gbl...
Dear all,

I am developing a project using VB.NET. I would like to
add icons in the resource file like VB6 to use with my
buttons. But I can't find how to add resource file in
VB.NET and how to retrieve from it. Please give me a
guide how to do this.

Thanks,
Kyaw Soe Lin



Jul 19 '05 #4

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

Similar topics

5
by: Eric | last post by:
I want to use embedded icon resources for my file type associations, but only the app.ico seems to show up when I go to choose the icons in the setup File Types editor. The same thing when I try...
3
by: J.Marsch | last post by:
Hello all: I am trying to build a resource dll that will house icons, and I'm afraid that I'm not having much luck reading it. Can you lend hand (or just point me to a good primer). Here's...
6
by: Kyaw Soe Lin | last post by:
Dear all, I am developing a project using VB.NET. I would like to add icons in the resource file like VB6 to use with my buttons. But I can't find how to add resource file in VB.NET and how...
2
by: SharpCoderMP | last post by:
i'm trying to embed multiple program icons in my executable. the only way so far i managed to do that is to embed native win32 resource file with multiple icons. it works, but... when i create a...
4
by: JR | last post by:
Hi, How can I add multible icons into 1 file likeSHELL32.dll from windows it has about 50 Jan
3
by: Jeff Jarrell | last post by:
We are migrating a large app to .net. There are many forms and there will be many, many icons. What are some suggested techniques for more or less sharing imagelists (easy enough), BUT without...
1
by: John | last post by:
Is there such a thing as storing icons or bitmaps into a resource file, and adding more icons or bitmaps into the resource file at runtime? I want to store a bunch of icons into a resource file,...
3
by: Christian Reizlein | last post by:
How can i compile my application with more than 1 icon ? i have tryied adding external .ico to the solution and settign them to content or resource but then they are not visible as normal icons of...
2
by: bahnfire | last post by:
Hi, I am hoping that I finally have the right group :-) I am using Visual C++ Express 2008 and am trying to change the taskbar icon that I am using (notifyIcon1) as some state changes (button...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
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
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
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,...

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.