Resource File

  • Thread starter Thread starter Barry
  • Start date Start date
B

Barry

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
 
Hello,

Barry said:
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.
 
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\resourcesandlocalization\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 said:
Hello,

Barry said:
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.
 
Hello,

Nice Chap said:
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.
 
Back
Top