I have 开发者_StackOverflowa Icon(.ico file) in the (VB.NET)MyProject>Resources.resx file.
How do I extract it in run-time as a Icon object?
Thanks
You should be able to do the following:
Dim myIcon as Icon = [Your Project Namespace].Properties.Resources.[icon name]
It should pop up with Intellisense.
NOTE: My VB is a bit rusty and I've been using VS 2008 for quite some time, so my apologies if this isn't quite right in syntax or not the way to do it in VS 2005.
UPDATE: Apparently the VB way of accessing [Your Project NameSpace].Properties
is to use the My
keyword:
Dim myIcon as Icon = My.Properties.[icon name]
Your icon will show up with intellisense under My.Resources as in:
My.Resources.<name of icon>
精彩评论