Tutorial C# Get Con...
 
Notifications
Clear all

Tutorial C# Get Control Of Resource Images Using Resource String

Page 1 / 2

KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 9 years ago

Hey RG

Today ill be Showing you how to control your resources images using the string of the resource

the point of this was that i can control the displayed image in picture box by selected Index from combo box and i found a solution for that some time ago and just forgot to share it with you guys

so lets get started

Things we need !
1.Drop Picture box to your Form
2.Drop Combo box to your Form
3.Drop few images in resources of your project and remember the names

Now the usage !
1.in Combo box collection type image names one after another by line down
2.double click the combo box and paste this code inside . and rename tools names to yours
[HIDE]

	System.Resources.ResourceManager Resource = new global::System.Resources.ResourceManager("Your_Project_Name_Here.Properties.Resources", typeof(Your_Project_Name_Here.Properties.Resources).Assembly);
	            object obj = Resource.GetObject(Combobox_Name_Here.GetItemText(Combobox_Name_Here.SelectedItem));
	            Picture_Box_Name_Here.Image = ((System.Drawing.Bitmap)(obj));
	

[/HIDE]

Now when selecting image string in combo box it will display the image you selected 🙂

if you need help to understand it or something feel free to PM me

Have Fun !

Reply
Name of the Video Game, and any other Tags
5 Replies
Cyb3r
Posts: 1598
(@cyb3r)
Noble Member
Joined: 10 years ago

Awesome tutorial Krank, keep it up buddy. 🙂

Reply
KranK
Posts: 336
Topic starter
(@KranK)
Reputable Member
Joined: 9 years ago

Awesome tutorial Krank, keep it up buddy. 🙂

Thank you boss ^-^

Reply
LEGACYY
Posts: 2350
(@legacyy)
Noble Member
Joined: 9 years ago

Hey RG

Today ill be Showing you how to control your resources images using the string of the resource

the point of this was that i can control the displayed image in picture box by selected Index from combo box and i found a solution for that some time ago and just forgot to share it with you guys

so lets get started

Things we need !
1.Drop Picture box to your Form
2.Drop Combo box to your Form
3.Drop few images in resources of your project and remember the names

Now the usage !
1.in Combo box collection type image names one after another by line down
2.double click the combo box and paste this code inside . and rename tools names to yours
Hidden content cannot be quoted.

Now when selecting image string in combo box it will display the image you selected 🙂

if you need help to understand it or something feel free to PM me

Have Fun !

Professional Coder over here (y) True Legend Nice Tutorial KranK

Reply
1UP
Posts: 25
 1UP
(@1UP)
Eminent Member
Joined: 10 years ago

Hey RG

Today ill be Showing you how to control your resources images using the string of the resource

the point of this was that i can control the displayed image in picture box by selected Index from combo box and i found a solution for that some time ago and just forgot to share it with you guys

so lets get started

Things we need !
1.Drop Picture box to your Form
2.Drop Combo box to your Form
3.Drop few images in resources of your project and remember the names

Now the usage !
1.in Combo box collection type image names one after another by line down
2.double click the combo box and paste this code inside . and rename tools names to yours
Hidden content cannot be quoted.

Now when selecting image string in combo box it will display the image you selected 🙂

if you need help to understand it or something feel free to PM me

Have Fun !

You can also do this in the application property window. It cuts a little bit of the code out but for anyone who would rather just have it all right there, this works just as nice.

Reply
Page 1 / 2