PC Review


Reply
Thread Tools Rate Thread

How to add icons into resource file

 
 
Kyaw Soe Lin
Guest
Posts: n/a
 
      29th Jul 2003
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
 
Reply With Quote
 
 
 
 
Mick Doherty
Guest
Posts: n/a
 
      29th Jul 2003
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.GetManifestResourceStream("YourProject.YourIcon.Ic
o"))
"Kyaw Soe Lin" <(E-Mail Removed)> wrote in message
news:08d801c355b6$e4ea3930$(E-Mail Removed)...

> 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



 
Reply With Quote
 
Charles Law
Guest
Posts: n/a
 
      29th Jul 2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.GetManifestResourceStream("YourProject.YourIcon.Ic
> o"))
> "Kyaw Soe Lin" <(E-Mail Removed)> wrote in message
> news:08d801c355b6$e4ea3930$(E-Mail Removed)...
>
> > 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

>
>



 
Reply With Quote
 
Mick Doherty
Guest
Posts: n/a
 
      30th Jul 2003
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > 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.GetManifestResourceStream("YourProject.YourIcon.Ic
> > o"))
> > "Kyaw Soe Lin" <(E-Mail Removed)> wrote in message
> > news:08d801c355b6$e4ea3930$(E-Mail Removed)...
> >
> > > 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

> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding icons in resource file John Microsoft C# .NET 0 23rd Mar 2008 08:06 PM
Disposing strings created from a resource file using resource mana =?Utf-8?B?TXVydGh5?= Microsoft Dot NET Compact Framework 3 25th Jun 2007 03:30 PM
Failed to load resource from resource file. Plese check up your setup Andry Microsoft Dot NET Framework 0 22nd Nov 2005 07:52 AM
Using a resource file for icons J.Marsch Microsoft C# .NET 3 4th Dec 2004 12:59 AM
can I call getString() to get a string from a separate resource file instead of embedded resource? babylon Microsoft Dot NET Framework 2 7th Oct 2003 04:13 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:47 PM.