472,096 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

Resource File

I have looked for this answer but no luck so far

In VB 6 I could used a resource file to hold icons which I could then use
throughout my program.
I have not yet found out hw to do this in VB.net.

Could someone point me in the right direction please

thankyou

--

****
Barry
****

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.518 / Virus Database: 316 - Release Date: 11/09/2003
Nov 20 '05 #1
3 4361
Hello,

"Barry" <ne**@bazmech.net> schrieb:
I have looked for this answer but no luck so far

In VB 6 I could used a resource file to hold icons which
I could then use throughout my program.
I have not yet found out hw to do this in VB.net.


Add the icon file to your project and set its 'Build Action' property to
'Embedded Resource'. You can use the code below to load the icon at
runtime:

\\\
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAssembly().GetManifestResourceStream( _
"WindowsApplication1.Ball.ico" _
) _
)
///

'WindowsApplication1' is the root namespace of the application, "Ball.ico"
is the icon's filename.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #2
VS.net comes with a Resource Editor. MS ships only the source code for it
not the executable.
You may find it at:

C:\Program Files\Microsoft Visual Studio
..NET\FrameworkSDK\Samples\Tutorials\resourcesandl ocalization\reseditor

If you use the batch file to comile the source code, you need to run the
batch file from .Net Command Prompt.

Once compiled, you can create .res or .resx files using the Resource Editor
and include the .Res(x) file in your project.
"Herfried K. Wagner [MVP]" <hi*******@m.activevb.de> wrote in message
news:e8**************@TK2MSFTNGP12.phx.gbl...
Hello,

"Barry" <ne**@bazmech.net> schrieb:
I have looked for this answer but no luck so far

In VB 6 I could used a resource file to hold icons which
I could then use throughout my program.
I have not yet found out hw to do this in VB.net.


Add the icon file to your project and set its 'Build Action' property to
'Embedded Resource'. You can use the code below to load the icon at
runtime:

\\\
foo.Icon = _
New Icon( _
[Assembly].GetExecutingAssembly().GetManifestResourceStream( _
"WindowsApplication1.Ball.ico" _
) _
)
///

'WindowsApplication1' is the root namespace of the application, "Ball.ico"
is the icon's filename.
--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet

Nov 20 '05 #3
Hello,

"Nice Chap" <Ni******@PlasmaDyne.com> schrieb:
VS.net comes with a Resource Editor. MS ships only the source
code for it not the executable.


Have a look at the "WinRes.Exe" tool too.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
http://www.mvps.org/dotnet
Nov 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Gabriel Lozano-Morán | last post: by
2 posts views Thread by Joe Thompson | last post: by
11 posts views Thread by Alan T | last post: by
7 posts views Thread by craig | last post: by
reply views Thread by leo001 | last post: by

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.