By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,692 Members | 1,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,692 IT Pros & Developers. It's quick & easy.

Resource File

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.