Remove icon from Win32 resources in Windows Forms - winforms

While making a Forms app, I added an icon file to the Icon field of the resources:
I now changed my mind, and want to use the default icon. Is there a way to clear that field? I tried deleting the file, and now it just won't compile. Restarting Visual Studio does nothing.
I know there's a way to get the default icon from the assembly files, but isn't there a way to simply reset that to its original state?

Related

Failed to load toolbox item in VIsual Studio in WinForms C++

I am creating a windows form application in managed C++. To add a custom user control either one can create a new project or add CLR User control to same project. When I add a user control to same project it builds and shows control in toolbar. When I drag and drop it onto my main UI it throws up error.
"Failed to load toolbox item, It will be removed from Toolbox".
There is no error if I create a separate project under same solution and compile control as a DLL. Is there a way I can add a custom user control to same project and use it.
Also I looked up similar question on the topc but none of them has helped me. I have checked the files and I am building the project as Win32 and there is no way control being separately built as x64.
Had same problem after one or both of renaming project or/and changing platform, most posted "solutions" provided to other people asking the same question didn't seem to work.
What did work for me was to go into the project folder and delete the obj folder, and just to be safe the bin folder too, then build again. (Seems the so called Build->Clean menu item only does half of the required work.)

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.

Having trouble setting the icon in MSVC 2008

I am making a C++/CLR Winforms application in MSVC 2008, but I can't seem to set the icon.
I have added a .ico file as a Resource (Add->Resource->Icon->Import) and added a line to the .rc file (and fully recompiled, but nothing has changed; it still uses the default icon.
There are no other icons added. I can see and edit the .ico with the in-built icon editor; it has both 16x16 and 32x32 sizes.
What else do I have to do?
[Edit] Just noticed that my icon is correctly showing in Windows Explorer, but not in the application when it runs.

Toolbar Icons usage in Visual Studio 2010 Express

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

Changing the default file path for icons in Visual Studio

On a WPF project, if I have an image and click on 'Source' and then 'Add' I get the choice to import images into the project. Is there a way of changing this file location?
VS2010 currently defaults to the "Libraries / Pictures" setting. I'd rather not change where this library points to as I don't store icons and pictures together.
After a bit of research I set up a new Windows library (useful article here) for icons but I can't work out how to set VS to default to the icons library I created, does anyone know how to do this?
Using Process Monitor on my machine when doing this, I see the following:
Calls to RegOpenKey, RegQueryKey aimed at:
HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\ComDlg32
This seems to be a list of the last projects I've added/opened in Visual Studio. To test this, I added a project from a different location to my solution, then tried to change the source of the image.
Sure enough, the dialog defaulted to that location.
Your mileage my vary, but certainly, on my machine, the behaviour seems tied to what project I opened last. You can use Process Monitor to monitor devenv.exe while you choose an image on your machine to see what happens.
Given this, though, it would seem that you can't change this behaviour, although you can influence it.

Resources