Windows Develop Bookmark and Share   
 index > Windows Forms General > using resources for bitmaps on buttons
• Windows Forms General
• Windows Forms Designer
• ClickOnce and Setup & Deployment Projects
• Windows Forms Data Controls and Databinding
• Windows Forms Sample Applications

using resources for bitmaps on buttons

When creating a button in Forms Designer a dialog box is shown with either local or file import. Whatever I do, the icon is added to the list of resources (tree depending on the solution root in solution explorer).

But when adding new items on the tree I am unable to use it to insert a images... I lack doing something (declaring each resource as embedded, or whatever), what I can't figure out what.

Any idea, please?

thanks

amc  Saturday, January 21, 2006 2:57 PM

You have to insert the reference for the new image on the Resources.resx file in the properties folder, look at image you added using the desinger and you will get the idea, also, you need to add accessor for it on the Resources.Desinger.cs, to allow the call: Resources.NewImage, learn the syntax in the same way.

Eli Gazit  Saturday, January 21, 2006 4:26 PM
thanks, sounds complicated anyway

I have the Solution Explorer, and right click on the Resources Folder, Add Existing Item, and choose several bitmaps. Is it the right way to "store" bitmaps as resources?

If it is, how to assign them to buttons???

thanks


amc  Saturday, January 21, 2006 7:18 PM

You can use google to search for other answers

 

More Threads

• checking if a key is pressed
• DataGridViewComboBoxColumn
• ItemMouseHover
• Status Bar in COM Interop
• How to assign Empty Value to DateTimePicker?
• how to move from Form to Form?
• Multiline tab page header text.
• Problem in TaskDialog Class
• I would like to select a particular text as bold
• Failure to detect changes when multiple controls are bound to a single dataview?