简体   繁体   English

WinForms应用程序中的Images文件夹

[英]Images folder in WinForms application

What's the way to add custom images/icons in WinForms application. 在WinForms应用程序中添加自定义图像/图标的方式是什么。 I added a folder (right-click project and add new folder) named it then as my images folder and I would like to use this folder as my main images folder. 我添加了一个文件夹(右键单击项目并添加新文件夹),然后将其命名为我的图像文件夹,我想将此文件夹用作我的主图像文件夹。

I don't see any option to use my 'images' folder in Visual Studio after dropping the Picture Box control. 删除图片框控件后,在Visual Studio中看不到使用“图像”文件夹的任何选项。

Add the image as an embedded resource. 将图像添加为嵌入式资源。 You can the set the PictureBox 's Image property to the resource via the property editor or at runtime by accessing the Properties.Resources object. 您可以通过属性编辑器或在运行时通过访问Properties.Resources对象将PictureBoxImage属性设置为资源。 The images will be compiled directly into your executable, you just need to add them to your project. 这些图像将直接编译为可执行文件,您只需将它们添加到您的项目中即可。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM