问题
I am trying to make a thumbnail toolbar for which I need an icon. So I added the icon using the solution explorer in the resources folder. Now, when I do Properties.Resources
the icon name does not appear.
Code can be found here:
Problem showing thumbnail toolbar in .net 3.5 form
回答1:
You also need to add the icon to the Resources.resx file. Open it in Visual Studio and drag your icon into the Icons menu of the resx and it will become available.
回答2:
As suggested by @fletcher you need to add the icon to Resources.resx
file.
You find the
Resources.resx
file in the Solution Explorer -> YourProject -> Properties. Right-click and open either Properties orResourses.resx
Right-click YourProject in the Solution Explorer and open Properties. You'll find a Resource-Tab on the project-page.
Note: Add your icon as Icon
in the resource-editor.
Further info on Adding and Editing Resources.
回答3:
Go to Project/ Properties/ Click on "Resources" mostly after Debug button.
Click on ComboBox, select Images (default its String).
Click on Add Resources. Click on "Add Existing File". Select the image you want to add.
once the image get added to the Resources folder, you can use it.
Ex: btn1.Image = Properties.Resources.Stop; //(Stop - image name)
来源:https://stackoverflow.com/questions/3520173/properties-resources-the-icon-name-does-not-appear-in-the-intellisense