0

I am porting a Linux Mono/GTK application to MS.NET/WPF. The application uses a toolbar, which I could have sworn VS had built in support for adding icons to through the WYSIWYG designer.

However, firstly, in the "Items" property, the add button is greyed out. I did some research and found that I could add <Button></Button> tags directly to the XAML, however, I still couldn't figure out how to add icons. I'd like to use the default Windows icons.

I then found that you had to add <Image></Image> tags to create typical icon based toolbar items, however, I didn't know where to find the default windows icons.

I read on a different stack exchange post that they are available in C:\Program Files\Microsoft Visual Studio 10.0\Common7\VS2010ImageLibrary\1033\VS2010ImageLibrary.zip

However, I am stuck with VS Express edition, and according to the MSDN website this archive doesn't exist in VSE.

My question is this: is there any way to use the default Windows icons?

Also, is it possible I've missed something? How do most people handle toolbars?

4

1 回答 1

1

All the system icons are not saved in the same place. They are spread across multiple dlls.

List of Windows 7 icons stored in imageres.dll is one such place. You can google for other stuff.

One you have the dll from which you want to create the WPF Image you can use Imaging.CreateBitmapSourceFromHIcon function after using LoadIcon

于 2012-07-22T15:05:53.817 回答