Properties.Resources the icon name does not appear in the intellisense

冷暖自知 提交于 2019-12-10 19:43:32

问题


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 or Resourses.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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!