[英]How to change launching icon of windows form application in microsoft visual c# 2010 express
When we start debugging the project, a form is available displaying the items. 当我们开始调试项目时,可以使用一个表格来显示项目。 It has a default icon containing a square block. 它具有一个包含方形块的默认图标。 Can we change that icon?? 我们可以更改该图标吗?
In the Properties of the Form you have the property Icon
. 在表单的属性中,您具有属性Icon
。 If you click on it you will get a little button where you can select a local file. 如果单击它,您将获得一个小按钮,您可以在其中选择本地文件。
If you want to change the Icon of the compiled exe file you need to go to the properties of your project (right click on projrct in project explorer -> properties) and change the default icon. 如果要更改已编译的exe文件的图标,则需要转到项目的属性(在项目浏览器中的projrct上单击鼠标右键->属性),然后更改默认图标。
goto form properties and choose icon select path of the images..... 转到表单属性并选择图标,然后选择图像的路径.....
form properties>icon>select>icon image. 表单属性>图标>选择>图标图像。
If you want to use custom icons, you need a way to create them. 如果要使用自定义图标,则需要一种创建它们的方法。 The free GIMP graphics program will export images as .ico files, just use one layer per icon (say 16x16, 32x32, 48x48 & 64x64). 免费的GIMP图形程序将图像导出为.ico文件,每个图标仅使用一层(例如16x16、32x32、48x48和64x64)。
The .ico file can then be dragged and dropped onto the Project Properties tab Resources/Icons pane. 然后,可以将.ico文件拖放到“ 项目属性”选项卡的“ 资源/图标”窗格中。 CustomIcon.ico will be named as (and recognised by IntelliSense) as CustomIcon . CustomIcon.ico将被命名为(并被IntelliSense识别为) CustomIcon 。 This is built in at compile time and has no need to reference external files at run time. 它是在编译时内置的,不需要在运行时引用外部文件。
It can be used to change the window title bar icon from the Form Code as follows: 可以使用它从“表单代码”更改窗口标题栏图标,如下所示:
Size size = new Size(16,16);
this.Icon = new Icon(YourProject.Properties.Resources.CustomIcon, size);
You could read this msdn article 您可以阅读此msdn文章
http://msdn.microsoft.com/en-us/library/339stzf7.aspx http://msdn.microsoft.com/zh-CN/library/339stzf7.aspx
In the Form Code Side: 在表单代码方面:
this.Icon = new Icon(@"C:\...");
In the Designer is in the Property-Window a property for the Form. 在设计器中,属性窗口是表单的属性。
右键单击表单=>属性=>图标
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.