Archive for the ‘.net’ Category

Visual Studio: Create An Uninstaller Shortcut In Your Installer Wizard

Creating a setup wizard within Visual Studio does not include an uninstall shortcut with it. The uninstalleasiest and quickest way would be to do the following. This post assumes you already know how to create a setup wizard.

Create a batch file (say name it uninstall.bat) with the contents below
@echo off
msiexec /x {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}

Where {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx} is the product code that is found in your setup project’s product code. Make sure you include the brackets as well.

Under Application Folder, right click, choose ADD, then FILE and browser to where uninstall.bat is located. Under User’s Program Menu, right click and create a shortcut. Then browser to Application Folder and choose the uninstall.bat file that you just added.

Rebuild your project and voila! Your uninstall shortcut is now included when the setup wizard installs your application.

Donations appreciated. Every little $ helps. Or click Google +1

C#: Add ToolTip To A PictureBox

While some controls within Visual Studio include a property to have a ToolTip, some do not. Take the case of a PictureBox. Since there is no tooltip property for you to set a tooltip text, you would have to do it programmatically. The ToolTip class is part of the System.Drawing namespace. To add a tooltip to a PictureBox object, simply do this code.

?View Code CSHARP
1
2
ToolTip tt = new ToolTip();
tt.SetToolTip(pictureBoxObject, "This is a tooltip text");

Donations appreciated. Every little $ helps. Or click Google +1

C#: System.Windows.Forms.FileNameEditor Not Found

This one was a mystery. Since using System.Windows.Forms.Design does not acknowledge that the FileNameEditor class exists, I thought adding a reference to it is the only solution. But which one? There is no System.Windows.Forms.Design DLL. Turned out to be Systems.Design under the .NET tab when you add a reference.

Donations appreciated. Every little $ helps. Or click Google +1

Related Posts with Thumbnails