如何获取应用程序的图标 [英] How to get application's icon

查看:418
本文介绍了如何获取应用程序的图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有vb .net 2008项目,我已经从项目属性>中设置了该项目的图标.应用程序选项卡,没问题.
问题是我想以MDI表单加载方式编写代码以获取应用程序的图标并将其传递给MDI表单,因此MDI表单图标采用相同的应用程序(exe)图标.
我试图通过此代码获取它,但是我没有找到保存应用程序图标的属性:
Me.Icon = My.Application.Info.

Hello everybody,
i have vb .net 2008 project i''ve set the project''s icon from the project properties > application tab, no problem with that.
the problem is i want to write code in MDI form load to get application''s icon and pass it to the mdi form so the mdi form icon takes the same application (exe) icon.
i''ve tried to get it by this code but i didn''t find the property that holds the application''s icon:
Me.Icon = My.Application.Info.

thanks in advance.

推荐答案

这是C#语言,但转换为VB应该不是问题.

This is in C#, but it shouldn''t be a problem for you to convert to VB.

private void StatsForm_Load(object sender, EventArgs e) 
{ 
    Icon = new System.Drawing.Icon("myicon.ico"); 
} 


这篇关于如何获取应用程序的图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆