从resx加载图标 [英] Load icon from resx

查看:98
本文介绍了从resx加载图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都有一个提示,在哪里可以找到信息/示例如何从.RESX文件中检索图标




/ k

Anybody has a tip of where to find info/example how to retrieve an icon
from a .RESX-file?

/k

推荐答案

Dim p As System.Reflection.Assembly

p = System.Reflection.Assembly.GetExecutingAssembly()

Icons(0)= New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),

" GreenBulb.ico"))

图标(1)= New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),

" YellowBulb.ico"))

Icons(2)= New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),

" RedBulb.ico"))


希望它有所帮助

克里斯


PS。确保你将图标设为嵌入式。


" kurt sune" < ap*@apa.cx>在消息中写道

新闻:uW ************* @ TK2MSFTNGP12.phx.gbl ...
Dim p As System.Reflection.Assembly
p = System.Reflection.Assembly.GetExecutingAssembly()
Icons(0) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"GreenBulb.ico"))
Icons(1) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"YellowBulb.ico"))
Icons(2) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"RedBulb.ico"))

Hope it helps
Chris

PS. Make sure you make the icons as embedded.

"kurt sune" <ap*@apa.cx> wrote in message
news:uW*************@TK2MSFTNGP12.phx.gbl...
任何人都有一个小费的地方查找信息/示例如何从.RESX文件中检索图标

/ k
Anybody has a tip of where to find info/example how to retrieve an icon
from a .RESX-file?

/k


Dim p As System.Reflection.Assembly

p = System.Reflection.Assembly.GetExecutingAssembly()

Icons(0)= New System.Drawing.Icon( p.GetManifestResourceStream(Me .GetType(),

" GreenBulb.ico"))

Icons(1)= New System.Drawing.Icon(p.GetManifestResourceStream(我.GetType(),

" YellowBulb.ico"))

Icons(2)= New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType( ),

RedBulb.ico))


希望它有帮助

克里斯


PS。确保你将图标设为嵌入式。


" kurt sune" < ap*@apa.cx>在消息中写道

新闻:uW ************* @ TK2MSFTNGP12.phx.gbl ...
Dim p As System.Reflection.Assembly
p = System.Reflection.Assembly.GetExecutingAssembly()
Icons(0) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"GreenBulb.ico"))
Icons(1) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"YellowBulb.ico"))
Icons(2) = New System.Drawing.Icon(p.GetManifestResourceStream(Me .GetType(),
"RedBulb.ico"))

Hope it helps
Chris

PS. Make sure you make the icons as embedded.

"kurt sune" <ap*@apa.cx> wrote in message
news:uW*************@TK2MSFTNGP12.phx.gbl...
任何人都有一个小费的地方查找信息/示例如何从.RESX文件中检索图标

/ k
Anybody has a tip of where to find info/example how to retrieve an icon
from a .RESX-file?

/k


请参阅以下文章:

http://www.codeproject.com/vb/net/embeddedresources.asp

-

Mike


Mike McIntyre

Visual Basic MVP
www.getdotnetcode。 com


" kurt sune" < ap*@apa.cx>在消息中写道

新闻:uW ************* @ TK2MSFTNGP12.phx.gbl ...
See the article at:

http://www.codeproject.com/vb/net/embeddedresources.asp
--
Mike

Mike McIntyre
Visual Basic MVP
www.getdotnetcode.com

"kurt sune" <ap*@apa.cx> wrote in message
news:uW*************@TK2MSFTNGP12.phx.gbl...
任何人都有一个小费的地方查找信息/示例如何从.RESX文件中检索图标

/ k
Anybody has a tip of where to find info/example how to retrieve an icon
from a .RESX-file?

/k


这篇关于从resx加载图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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