You liquidated her, eh? Very resourceful...

Long time, no blog. What can I say? I've been to the "Happiest Place On Earth"

But, now that I'm back, here's a neat little trick that I learned about how to embed and use graphic resources in a Visual Studio .NET application. For my example, I'm assuming that I have an icon file named "Test.ico".
  1. Using visual studio or another tool, you can create a bitmap, jpeg, gif, or Icon.
  2. Put that file in the same directory as the rest of your project.
  3. Then Add the file to the project (Add Existing Item...) and add the file.
  4. Change the Build Action of the file to be "Embedded Resource"
  5. When you want to use the file, simply add the following code (or something similar):

Dim _icon as Icon = New Icon(Me.GetType(),"Test.ico")


Now you have a real icon that can be used for any number of things (application icon, status icon, etc.)

Comments

Popular posts from this blog

Database Projects, SQL Unit Tests, and TeamCity

Building nice XML from SQL Server Tables

Brent: Programmer. Gamer. Cheapskate. All around good guy.