Monthly Archives: April 2013

ListBox selected item custom background and text color

This snippet will allow you to set a custom color for your ListBox’s selected item background as well as the selected items text color.

First make sure that your ListBox’s DrawMode is set to OwnerDrawFixed. This can either by done in the controls properties window or by calling listBox1.DrawMode = DrawMode.OwnerDrawFixed;

Then we need to handle the ListBox’s DrawItem event which is where we will be doing the changes to the selected items.

How to disable plugin-container

Plugin-container.exe is a Firefox process that is used to load plugins separately so if a plugin crashes for whatever reason, Firefox won’t be affected by the crash and will stay responsive.

Since there are a lot of people experiencing problems with the plugin-container process I wanted to provide you with two easy methods for disabling it.

In older versions of Firefox it was possible to disable plugin-container.exe by following the steps below.

First method

  1. Enter about:config in your address bar
  2. Search for dom.ipc.plugins.enabled
  3. Set their values to false

Sadly the above method doesn’t seem to work anymore with the newer versions of Firefox. Luckily there is a different workaround which can achieve the same exact result by setting a system or a user environment variable. Follow the steps below if the first method did not work for you.

Second method

  1. Right click on your computer icon on the desktop and click properties
  2. Go to Advance system settings
  3. Click the button called "Environment Variables"
  4. Click the “New” button under User variables or System variables depending if you want the change to affect all the users on the system or just the one you are currently logged as
  5. Set the variable name to MOZ_DISABLE_OOP_PLUGINS and its value to 1

And that is all you have to do. Now simply restart Firefox and you will notice that the plugin-container.exe process will not be used any more.

Visual Studio 2012 Update 2

Microsoft has released Visual Studio 2012 Update 2 (Visual Studio 2012.2). This update contains numerous features as well as bug fixes and also includes all the changes of the first update which means you can safely skip update 1 if you haven’t already installed it.

For detailed information on what update 2 has to offer visit http://support.microsoft.com/kb/2797912

Visual Studio 2012 Update 3 is now available. Read Visual Studio 2012 Update 3 for more information.

How to create and connect to an SQLite database in C#

The aim of this tutorial is to teach you how to create a new SQLite database from scratch, create a new table in it, insert and read values from it. This is merely an entry level example to give you an idea on how to start.

First you will need System.Data.SQLite library from system.data.sqlite.org. Head over to their download section and download the libraries that best suit your need depending on the .NET Framework you want to target and the Windows bit version.

Extract the file and add System.Data.SQLite.dll as a reference in your project. Keep in mind that SQLite.Interop.dll also needs to be in your executables directory but doesn’t need to be added as a reference in your project. Moreover, if your application is targeting Any CPU it is likely that you will get an exception. So make sure to navigate to Project properties -> Build and set the Platform target to the bit version of the System.Data.SQLite.dll binary you have downloaded.

Visual Studio application build settings - Platform target

Finally, the snippet below should give you the general idea on the main functions you will need to learn first, mainly

  • Creating a file for your database
  • Creating a table in your database
  • Inserting information in the database
  • Retrieving information from the database

Microsoft Update KB2823324 has been recalled

windows-logoMicrosoft has recalled one of their recent windows updates yesterday. The update was causing a lot of Windows 7 systems to have a blue screen (0xc000021a Stop error) or generate event errors with ID 55 and may even cause your system to not be able to boot upon restart.

Microsoft has already removed the update from windows updates list and they are recommending their users to uninstall the update from their systems if they have already installed it. For more information and step by step instructions on how to remove the update visit http://support.microsoft.com/kb/2839011