Store your icons in a DLL file
Heres your chance to share your own tutorials with the community. Just post them on here. If your lucky they may even be posted on the main site.
8 posts
Page 1 of 1
in this tutorial i'll show you how to add images/icons to a dll file then use them in your app.
1. first will make the the dll file
create a new class library project the go to MyProject > Resources > Images > Add Resource > Add Existing File (add as many resources you want)
then under your Public Class write this code
2. Create a Windows Form Project(and reference the dll you've just created)
add a button or a picturebox whatever supports "Image" or "BackgroundImage"
then in your form load event add this code
Simple but i believed it was worth sharing.
1. first will make the the dll file
create a new class library project the go to MyProject > Resources > Images > Add Resource > Add Existing File (add as many resources you want)
then under your Public Class write this code
Code: Select all
now compile your project Public Shared Function Button1Image() As System.Drawing.Bitmap
Return My.Resources.btn1Image 'replace btn1 with the name of your image
End Function
2. Create a Windows Form Project(and reference the dll you've just created)
add a button or a picturebox whatever supports "Image" or "BackgroundImage"
then in your form load event add this code
Code: Select all
That's ItButton1.Image = myDll.Class1.Resources.btn1Image
Simple but i believed it was worth sharing.
You can find me on Facebook or on Skype mihai_92b
It might be simple, but it's wrong. In the form load event, you would have
Code: Select all
Button1.BackgroundImage = myDll.Class1.Button1Image()
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
MrAksel wrote:It might be simple, but it's wrong. In the form load event, you would haveyes, and why is it wrong?Code: Select allButton1.BackgroundImage = myDll.Class1.Button1Image()
You can find me on Facebook or on Skype mihai_92b
You have the wrong code in your topic. It should be replaced with what I posted.
You do not have any nested class named "Resources" inside Class1.
Just look at your code and try to compile it and you will see
You do not have any nested class named "Resources" inside Class1.
Just look at your code and try to compile it and you will see
LMAOSHMSFOAIDMT
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Laughing my a** of so hard my sombrero fell off and I dropped my taco lmao;
Over 30 projects with source code!
Please give reputation to helpful members!
Hey
Yeah a great tutorial and it worked first time for me
nice
Chris
Yeah a great tutorial and it worked first time for me
nice
Chris
hungryhounduk wrote:Hey
Yeah a great tutorial and it worked first time for me
nice
Chris
wow i am searching this for a month in total now i got the tutorial(Store your icons in a DLL file) , thank you so much
clapper; wahooo;
Find my programs on Softpedia
Just been messing with it
Chris
Code: Select all
added 5 buttons and it all works really well Button1.BackgroundImage = ClassLibrary6.Class1.Button1Image()
Button2.BackgroundImage = ClassLibrary6.Class1.Button2Image()
Button3.BackgroundImage = ClassLibrary6.Class1.Button3Image()
Button4.BackgroundImage = ClassLibrary6.Class1.Button4Image()
Button5.BackgroundImage = ClassLibrary6.Class1.Button5Image()
Button1.BackgroundImageLayout = ImageLayout.Center
Button2.BackgroundImageLayout = ImageLayout.Center
Button3.BackgroundImageLayout = ImageLayout.Center
Button4.BackgroundImageLayout = ImageLayout.Center
Button5.BackgroundImageLayout = ImageLayout.Center
Chris
8 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023