Toolbar Icons usage in Visual Studio 2010 Express - wpf

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?

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

Related

Missing Toolbox Items in VS 2013

I'm developing a WinForms application using Visual studio 2013. I have two user controls and 1 custom control in my project. Unfortunately for some reason they are not appearing in my toolbox at design. At one point they did briefly but disappeared and never returned. I have tried resetting the toolbox, checking the AutoPopulate option and made sure that my project is built. I've seen solutions about adding controls that exist in their own library but these exist within the same project. My classes also have a namespace and the ToolboxItem(True) attribute.
Thanks

Windows Forms Control Library template

we are trying to use an activex control from WPF to save a rewrite right now. Found this article , https://msdn.microsoft.com/en-us/library/ms742735(v=vs.100).aspx that refers to the Windows Forms Control Library Template. now I have Visual Studio 2015 Community Edition and there is no such template. Googled and just found pages with no usable content. was wondering if I could be pointed to where this exist or is there an alternative?
The Windows Forms Control Library Template is a litte bit difficult to find. In my Visual Studio 2015 implementation I have it in the directory Visual C#\Windows\Classic Desktop. If you don't have this template, at least for Windows Forms you can also choose template Class Library and later change it in in such a way that you can use the Testcontainer when debugging your class library.
For how to achieve this see the post of Arnshea (6 upvotes) in this link A project with output type of class library cannot be started directly - with a startup exe. I have used his technique when I accidently used the wrong template when starting my projects.
Regards JRB

Editing the standard WPF Aero theme

I want to look into the default styles that are used for the default WPF application so that I can experiment/tweak them. (I believe this to be the standard AERO theme)
So I downloaded the default themes from Microsoft, and manually applied the AERO theme.
I added the "Aero.NormalColor.xaml" file into my project
I then added "PresentationUI.dll" and "PresentationFramework.Aero.dll"
I then modified the namespace from "xmlns:theme="clr-namespace:Microsoft.Windows.Themes;" to "xmlns:theme="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" (It was throwing errors otherwise)
Finally I add it into the Apps resource dictionary
But it ends up looking slightly different, in particular, menus seem to look different. So I guess I'm running the wrong theme.
This is using VS 2010 and the default new .net4 WPF application project
Those default themes you downloaded could be god knows what. Probably not what is shipped with the actual .NET framework and Windows.
I don't know what your end goal is, but I would suggest looking at the XAML of a specific control you are interested in Blend. It was a pretty simple action, something like right click -> edit control template, although I can't remember the exact steps (like where to click exactly etc). I'm sure you can google that information very quickly...

Making icon for a Windows Form: How to make it show up correctly?

OK, so I have built a Windows Form application. I now want an icon for it. So I use the Icon Editor built into Visual Studio 2012. Draw it all out to look nice and purdy. Once I am done, I have a .ico file and I make it the default icon for the project, and also the icon for the one WinForm in the application.
Unfortunately, it does not show up as I have created it! It is displayed as the default icon file as it existed before I modified it in the icon editor. It's a 32x32 4 bit icon. If I change the extension to .bmp it shows up as the default.
It looks like the VS icon editor is editing something else, not the appearance of the icon. Can someone tell me what I am doing wrong?
I used to have a progam called IconArt that would create icons that looked like icons when I used them in VS. IconArt is now abandonware and won't run on my 64bit Windows workstation.
Since I didn't get any answers within the time I was hoping, I posted this question also in the MSDN Visual Studio forum, and got a good answer that I thought I should post here. Credit to Reed Copsey, Jr, for the answer!
This is it:
You'll need to put your design in all of the different versions. ICO
files contain multiple versions of the same image, for different
screen resolutions.
My personal preference is to not use VS - there's an ICO plugin for
Paint.Net (all free) which allows you to make a single image
(typically 256x256), and save multiple versions within an ICO file in
one shot. It's very useful for building icons.
See
http://forums.getpaint.net/index.php?/topic/927-icon-cursor-and-animated-cursor-format-v37-may-2010/
for the plugin.
Since I am a Paint.Net user, the plugin sounded like a great idea, and I tried it. Bingo! This works very nicely.

Building Visual studio like application, need inputs

I am working on a Visual studio like application i.e. have a toolbox, an editor and property grid similar to VS.
User can drag and drop the controls(custom and third party) to the editor window and perform operations like resize, move, align, group etc.; Properties of that control needs to be displayed in property grid and user can update them from there.
As per my current understanding I will have to extend the Canvas to create my own editor and and Interface for controls which it supports; Each supported control will have to implement this interface so that it can be placed in our editor.
Something similar to this - http://www.codeproject.com/KB/WPF/WPFDiagramDesigner_Part4.aspx
Looking forward for any kind of help, comment or links.
If WPF is a requirement, wait for the VS2010 release and use the Visual Studio Shell in either isolated mode or integrated mode. Otherwise you can use the Visual Studio 2008 Shell isolated or integrated.
You'll get the docking support, addin model, editors with highlight and much more almost for free that way.
Finally, I used the Diagram designer approch to build my application. Although, I had to create my custom property grid which was painful.
Recently I came across following post which suggests that .Net DesignSurface can be used for building this kind of application -
How to create an UI Designer utility?
I have been working on a generic framework Wide to create VS like applications.
Update: Here is the CodeProject article on how to use the framework.
Wide comes with two modules and various out of the box functions:
Core module (Required)
Used for customizable splash screen
Used for Menus (supports regular menus with icon, checkable menus)
Used for Toolbar (menu view model can be reused for toolbars)
Multiple toolbars can be added to the IDE (check demo)
Themes (VS2010, VS2012 Light theme and no theme)
ThemeManager to add/remove themes
Used for Statusbar (in development)
Open file service with participatory handlers (could be based on extension or even file contents)
Save and restore layout along with opening documents
Logger module (For the logging tool)

Resources